1 2 Previous Next 15 Replies Latest reply on Aug 12, 2016 11:44 AM by adam.cotton

Each column a date: how to make a line graph

Hi All, I can't figure this out:

I have a data set where each Row is a unit, let's say SalesmanName

Among the columns are A) Sale 1 amount, B) Sale 1 date C) Sale 2 amount D) Sale 2 date.... etc.

I want to make a line graph of sales with Date on one axis and Amount on the other axis. I will filter by "Salesman"

The attached image is from the spreadsheet, you can imagine how it goes into Tableau.

I have been tearing my hair out, can anyone explain how to do this?

• 1. Re: Each column a date: how to make a line graph

The structure of your data is what is your issue.  It needs to be reshaped.  It needs to be in only 3 columns:  Sales Price, Sales data and Sale #.  There is a pivot option in Tableau for flat files, but I'm not sure if it will work for two sets of columns - Date & Sales.

• 2. Re: Each column a date: how to make a line graph

Thanks for the answer. There is no way to put it in only three columns, because the data is unique to each. That is to say, the date for "Sale1" is not the same for every "Sale1". It's unique to that row, of which there are thousands.

The search for this answer goes on. For the sake of simplicity of the answer, I said I can filter to just one of those rows, just to figure out how it should be done. X axis would be "Saledate" and Y axis "Saleprice" -- basically I need to stack five prices and five dates on a graph.

• 3. Re: Each column a date: how to make a line graph

I mistyped above - the 3 columns would be 1) Sales Price, 2) Sales DATE  &  3) Sales # (e.g., 1, 2, 3..)   So I still don't follow why this wouldn't work.

• 4. Re: Each column a date: how to make a line graph

I think you mean making duplicate rows (?) Each row is a distinct "Salesperson."

I don't see how it would be any easier to solve if I did that -- if I understand you correctly. Because then I would have five rows for each salesperson instead of five columns. I have five (distinct) sale dates with five (distinct) sale prices for each.

I'm inserting a screenshot to show more clearly that each row is different, so it can't just be price in rows and date in columns. That would be too easy : /

For Result Number "1" five sales on price/date dimensions, etc:

I don't understand why I can't just line 'em up in Tableau.

• 5. Re: Each column a date: how to make a line graph

If you can post that sample data on here I will manually reshape and show you.

• 6. Re: Each column a date: how to make a line graph

Great thanks so much. Attaching as a CSV for simplicity.

• 7. Re: Each column a date: how to make a line graph

After seeing your data. I've tried to restructure your data. Please go through the excel file first and then tableau workbook.

Let me know If you've any question.

Screen shot of data formatting:

Mahfooj

2 of 2 people found this helpful
• 8. Re: Each column a date: how to make a line graph

You missed Salesman column.

• 9. Re: Each column a date: how to make a line graph

I believe the result number column gives this.

• 10. Re: Each column a date: how to make a line graph

I understood Salesman like a column index. First group Salesman 1, ....

• 11. Re: Each column a date: how to make a line graph

Unfortunately this is not a solution in my case. The set actually contains 10,000 rows and about 30 columns, and this sorting operation would create an impractically large and complex file. This is the duplication of rows I alluded to above.

I'm very disappointed that there is no way in Tableau to simply select cells to use in a graph. I would have been satisfied to get a graph of just one row, ie filter by Salesman1 and drag five price pills on one axis, five dates dates on the other. Seems impossible.

Thanks very much for the replies in any case.

• 12. Re: Each column a date: how to make a line graph

I don't know how much this help you. But I think you can do something like this.

I haven't changed the format. I've just parameterized the SalesDates and SalesPrice. Just have a look and let me know If this help.

1 of 1 people found this helpful
• 13. Re: Each column a date: how to make a line graph

Hi.

Maybe be possible to bring lines like this:

If you can bring like this, it'll not increase your base soo much and Tableau will be able to transpose your data.

Now, i really didn't unsterdand your dissapointment.

Tableau is just a visualization toll, not an ETL tool. Tableau is not the problem, your data is the problem.

• 14. Re: Each column a date: how to make a line graph

Thanks again for the answer. Although this does not solve my problem, it helps because I had not considered parameters before, and maybe I can eventually find a solution this way.

One cannot consider the data the problem; it is in the most compact for possible. The work, time, and memory demands of separating it out into five times as many rows are prohibitive. I am very surprised this is not a recognized limitation in tableau.

The demand for this task would be similar to writing a sql query from the data set to plot the data for two axes, whereby

Axis X= select (column saleprice1, saleprice2, etc) from table where (column with row number is row "1")

Axis Y= select (column saledate1, saledate2, etc) from table where (column with row number is row "1")

Tableau should be able to allow us to select which cells to build the chart from, it's that simple. Probably there is a solution but this is very involved. Maybe with a calculated field?

1 2 Previous Next