You can create a calculated field as below and use this as filter selected TRUE.
There is no date field in my data. using just the month(jan,feb etc) or period(which is in numbers). In this case how will I be able to fetch the data?
First of all, this format is not appropriate because the cells are merged.
Please change them like below.
Then after connecting to this excel, choose data area and change them to Number decimal
Select same data area and Pivot data.
Or you need each value separately, you can create individual field to create more calculated field.
sample_SM_9.3.twbx 17.7 KB
As Shin mentioned you need to pivot your data, after this you just need to create 2 calculated fields
1) Date Month =
CASE TRIM( SPLIT( [Month], " ", 2 ) )
WHEN 'Jan' THEN 1
WHEN 'Feb' THEN 2
WHEN 'Mar' THEN 3
WHEN 'Apr' THEN 4
WHEN 'May' THEN 5
WHEN 'Jun' THEN 6
WHEN 'Jul' THEN 7
WHEN 'Aug' THEN 8
WHEN 'Sep' THEN 9
WHEN 'Oct' THEN 10
WHEN 'Nov' THEN 11
WHEN 'Dec' THEN 12 END,1)
2) DATEDIFF('month,TODAY(),[Date Month])=12.
Please try this and let me know, if you still have nay question.
Thank you for your response. I have changed the source data accordingly in order to get the report format. Please find attached the source format,tableau workbook and the report format i am trying to achieve. Could you help me to achieve this report format for last 1 year data.
Also I am unable to get the month names as 'Actual Apr 2016', or 'Actual Dec 2017' while displaying the report(as shown in 'Report Format' attached). is there a solution for this?
Thank You so much Shin.
I am going to try this on my live data now. The date month field which I have created using makedate, does it work well for live data as well?
Also, I am trying to put a month filter on the sheet such that each time I choose a different month,the respective last year data gets displayed. For example, Mar filter month dispalys april2016 to Mar 2017 and July filter displays Jun 2016 to july 2017 data. How can I achieve this?