Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I could use some help from this expert community. I'm trying to make a barchart that would display the following values based on a MonthYear dimension in my dataset:
1) Current Month
2) Prior Month
3) 2 mos Prior
4) Year Prior
5) A user inputted/adjustable Baseline period
These values should all adjust as the user selects a new month.
An example of the Dimension I would like to have if the current month is November
Format I would want the barchart to look like:
Any help you could provide would be greatly appreciated. Thanks!
Hi,
Well, you can create the calculated dimension as follows:
Create the following variable, and then add the Calculated dimension.
vMaxDateSelected = Date(Max(DateField));
=IF(DateField <= AddMonths('$(vMaxDateSelected)',-2), 'M-2',
IF(DateField <= AddMonths('$(vMaxDateSelected)',-1), 'M-1',
IF(DateField <= AddMonths('$(vMaxDateSelected)',0), 'Current Month')))
Hope that helps,
Carlos M
Hi,
Well, you can create the calculated dimension as follows:
Create the following variable, and then add the Calculated dimension.
vMaxDateSelected = Date(Max(DateField));
=IF(DateField <= AddMonths('$(vMaxDateSelected)',-2), 'M-2',
IF(DateField <= AddMonths('$(vMaxDateSelected)',-1), 'M-1',
IF(DateField <= AddMonths('$(vMaxDateSelected)',0), 'Current Month')))
Hope that helps,
Carlos M
Thanks! Yeah I was able to get it working using a combination of a baseline variable and a 4 month string variable that is created based on the max month-year available. Maybe not ideal, but it is running well so that solves the problem at least.