Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to show current and last year's weekend date sales (see attached). I am using a variable below to calculate last year's weekend date. The text box shows that the variable is working because I have a filter on the weekend field set to 5/27/2017 and the variable is showing the comparable date last year. The issue is that the "All Fuel Types Prior Year" column in the straight table is showing the filter date (i.e. 5/27/2017) value and not the value from 5/28/2016.
How anyone seen this issue before? Thank you in advance for any assistance!
Variable:
vPYWeekending: =Max(FormattedWeekEndDate)-364
Expressions:
Try to use this:
vPYWeekending: =addmonths(Max(FormattedWeekEndDate),-12)
BR
Ariel
Hi Ariel,
Thank you for the reply. That did not work. It produced a previous date of 12/30/1899. See attached.
I think the format of the field is not recognize...
try
vPYWeekending =addmonths((Max(Date#(FormattedWeekEndDate,'MM/DD/YYYY')),-12)
Same result (i.e. 12/30/1899).
can you attach data sample?
Hi Ariel,
Sorry for the delay. See attached sample app.
Thank you!
Hi,
you need to erase the equal sine in the variable....
and you don't need the Date#....
Hi Ariel,
Made the change but, the Prior Year column is still showing the Current Year. See attached.
I get the right numbers when I hardcode the prior year date in the PY expression like this:
Sum({$<FormattedWeekEndDate={'5/28/2016'}>}FuelMtrDtl_Posted_Units)
Even using the following expression without Aggr still shows the current year numbers:
Sum({$<FormattedWeekEndDate={'=$(vPYWeekending)'}>}FuelMtrDtl_Posted_Units)
None of the expressions above are expanding the variable correctly. The KPI in the screen shot does correctly expand the variable.
I believe the straight table is in the same "grain" with respect the the dimensions being used.
Try
Sum({$<FormattedWeekEndDate={"$(vPYWeekending)"}>}FuelMtrDtl_Posted_Units)