Not sure but find my approach as reference below and stored in attached workbook version 2018.2 located in the original thread.
1. Define parameter based on period
2. Define D1. Display 1: datediff('month',[Period Parameter],[Period])=0
3. Define D2. Display 2: datediff('month',[Period Parameter],[Period])=1
4. Define Sheet 1
5. Define sheet 2
6. Define dashboard and show parameter control
Hope it helps,
dash nalmai version 2018.2.twbx 29.6 KB
If you can show both on the same sheet (it doesn't have to be a dashboard) I suggest using a parameter with the selected period (or 2 parameters - one for the year and one for the month). Create a calculated field "Show" and check on each row whether the period matches the Parameter(s) OR the period - 1 month matches the parameter(s) and give them a value of "Yes", otherwise give them "No" and filter for "Yes" only (a hidden filter). In this case, for selected April 2017 in the parameter(s) you will only be showing April 2017 and May 2017.
For 2 separate sheets create the same parameter(s) and 2 calculated fields, let's say "Show period" and "Show next period". Use "Show period" for the first dashboard and show all entries matching the selected periods from the parameter(s) in Dashboard 1. Use "Show next period" and filter only entries from the month after the selected in the parameter(s) in Dashboard 2.
Does that make sense?
This is an example from my own project:
IF [Year (parameter)] = YEAR([Date]) OR [Year (parameter)]-1 = YEAR([Date])
THEN 1 ELSE 0
If you select 2017 in the parameter all entries with year 2016 and 2017 are assigned a value of "1" and all others "0", therefore filtering "Show" to "1" only shows 2016 and 2017 on the sheet.
Thanks for quick reply.
Here the problem is parameter will show the all periods in selection. we need to show the periods according to the case.
suppose case Apr 2017 r2 base has 4 periods form apr 2018 to July 2018. I need to show only those periods in selction like relative quick filter.
I don't quite understand but let's try:
revision case year period marginal Value
Revision1 Apr 2017 r2 base 2017 Apr 2017 30
Revision1 Apr 2017 r2 base 2017 May 2017 25
Revision1 Apr 2017 r2 base 2017 Jun 2017 15
Revision1 Apr 2017 r2 base 2017 July 2017 10
Revision1 May 2018 r2 base 2018 May 2018 20
Revision1 May 2018 r2 base 2018 Jun 2018 15
Revision1 May 2018 r2 base 2018 July 2018 20
Revision1 May 2018 r2 base 2018 Aug 2018 30
If you select May 2017 in the parameters, what do you want to see from these lines?
What do you mean by "in selection"?
If you see in my post, i need to show selected period and next period of selected period in tableau work sheet.
Here filter is the Period, suppose if i select jun 2017 period the worksheet has to show Jun 2017 and Next period July 2017 also.
Nobert has gave the solution it is working.
But In parameter it showing all the all the values, we need to show only relative values.
suppose, if i select Apr 2017 r2 base case in filter the period filter only need to show the apr 2017, May 2017, Jun 2017, and July 2017 but not all periods from all the cases. This is the issue currently im facing.