What have you managed to achieve so far? What have you tried?
Please upload a Tableau Packaged Workbook including some sample data to show what you've been able to achieve so we can go from there.
I am connecting to live data which has millions of records. I will have to build some dummy data as I have mentioned above.
Below are the 3 columns in my data set.
[Report Year] = [2016,2015,2014,2013,2012]
[Report Month] = [1,2,3,4,5,6,7,8,9,10,11,12]
[Sales Profit] = [123, 456, 789, etc...]
All the date functions tableau has need date format which I dont have. I have report month & year.
I hope I am explaining my question clearly?
If you still need some dummy data then I will have to create some. Let me know
Attached is the sample data.
I dont want to pull many years data when I need only current month/year and want to compare with previous.
But this is the sample data I have in DB
Let me know if you need further info?
Sample Data.csv.zip 841 bytes
For future reference please upload a Tableau Packaged Workbook with your sample data, not just the data.
I've prepared an example using the Sample - Superstore dataset.
Since this test dataset doesn't have 2016 data, I created a parameter called parameter_today_date which I can use to pretend the current date is in 2014. You would replace references to this field with a reference to the NOW() function.
Create a calculated field like follows;
datetrunc('month',[parameter_today_date]) = datetrunc('month',[Order Date])
datetrunc('month',dateadd('year',-1,[parameter_today_date])) = datetrunc('month',[Order Date])
Drag the field to your filters shelf and set it to true. You now have the sum of sales for last year and this year in the month of August.
yoyparameter.twbx 1.2 MB
Not able to open your example as I am on lower version of Tableau.
I want to use [Report Year] & [Report Month] as end user filters. If the user selects [Report Year] = 2016 and [Report Month] = 08 then I want to show [sales] comparison [Report Month] = 08 for 2015 & 2016. Selected Year v/s previous year for same month.
Apologies if I am not clear. Appreciate all your help here.
I'd never know you're on a lower version because you've never uploaded a Tableau Packaged Workbook.
I've outlined the calculated field I used in my above example. How about you go ahead and follow those instructions in Tableau and upload what you manage to get done in a Tableau Packaged Workbook.