-
1. Re: Missing months & Last 12 months
Mahfooj KhanJan 30, 2019 10:47 PM (in response to koushik.neelakantha)
Hi,
As per my understanding this is difficult to plot the missing months which are beyond the minimum date of the source. Tableau generate the axis based on the minimum and maximum date from your source and if any date is missing in between these range then using missing values option tableau populate the axis. This is how tableau deals with date field.
Now as per your requirement, we can always get the last 12 months data in the view only concern is to generate the axis for months which are not in the data beyond the minimum month. You need to do scaffolding with another source which contains all the month dates then you can join and generate the axis. That's the only solution which comes in my mind.
If you can manage to get the entry of missing months in your source then use below logic to get the latest 12 months data.
Drag this field in filters shelf and select "True"
DATETRUNC('month',[Date])>=DATEADD('month',-11,{MAX(DATETRUNC('month',[Date]))})
AND
DATETRUNC('month',[Date])<={MAX(DATETRUNC('month',[Date]))}
Hope this will help.
Mahfooj
-
2. Re: Missing months & Last 12 months
koushik.neelakantha Jan 30, 2019 10:59 PM (in response to Mahfooj Khan)Hi mahfooj, thanks a lot for the reply. For missing months beyond minimum date, we tried entering all the dates in excel and used that excel as a secondary/primary datasource with datablending but this approach has not worked
Regards,
Koushik.
-
3. Re: Missing months & Last 12 months
Mahfooj KhanJan 30, 2019 11:01 PM (in response to koushik.neelakantha)
Try to join instead of blend and check
-
4. Re: Missing months & Last 12 months
koushik.neelakantha Jan 30, 2019 11:17 PM (in response to Mahfooj Khan)Hi Mahfooj, tried using join still not working
-
5. Re: Missing months & Last 12 months
Mahfooj KhanJan 30, 2019 11:32 PM (in response to koushik.neelakantha)
Can you share some sample mock up data in an excel separated by sheets?
-
6. Re: Missing months & Last 12 months
koushik.neelakantha Jan 30, 2019 11:34 PM (in response to Mahfooj Khan)sure mahfooj i can..but the thing is..is there any way to delete this message after that
-
7. Re: Missing months & Last 12 months
Mahfooj KhanJan 30, 2019 11:45 PM (in response to Mahfooj Khan)
I've created one mock up data called and populated month from last year Jan 2018 to Feb 2019 and joined with your attached workbook this is what I got once joined.
You need to calculate the sales like this
RUNNING_SUM(ZN(LOOKUP(SUM([Sales]),0)))
Let us know if this help. Workbook as well as excel attached for reference.
Mahfooj
-
Date.xlsx 8.1 KB
-
Missing Months_v10.2.twbx 2.3 MB
-
-
8. Re: Missing months & Last 12 months
koushik.neelakantha Jan 31, 2019 12:16 AM (in response to Mahfooj Khan)thanks will check and let u know..
-
9. Re: Missing months & Last 12 months
koushik.neelakantha Jan 31, 2019 4:40 AM (in response to koushik.neelakantha)Hi Mahfooj, we almost got the solution. we have prepared a query and implemented Union to the existing table.
Regards,
Koushik