Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to compare the sum of Revenue for period based on current selection of a DateField VS The same period for
previous year and I am using the expression for previous year period:
Sum({<Datefield={'$(=addyears(DateField-1))'}>}Rev)
That works when the user select a single period but doesn't work when the user select multi period.
Sum({<Datefield={" >= $(=addyears(Min(DateField), -1)) <= $(=addyears(Max(DateField), -1))"}>}Rev)
Try this expression:
Sum({$+<[Fiscal Year]={"$(=AddYears([Fiscal Year],0)-1)","$(=AddYears(Min([Fiscal Year]),0)-1)"}>}Rev)
If you don't want to show them without a selection then you need to active the conditional expression check box and add this expression
GetSelectedCount([Fiscal Year])>0
Regards
None of the above work.. Any other suggestions?
Best,
Alec
Hi Waild,
the fiscal year field that you use, is it a year column? or full date? The solution doesn't work on my end.
Best,
Alec
This one should work
Sum({$<DateField={">= $(=addyears(Min(DateField),0) -1) <= $(=addyears(Max(DateField),0) -1)"}>}Rev)
Thank you for your help but still not working..
It is a year field. You might need to use Makedate function before addyears if you apply it on a full date. So try it with a year column
I also tried the following with no luck:
=Sum({$<RDATEValue={">= $(=addmonths(Min(RDATEValue),0) -12)"," <= $(=addmonths(Max(RDATEValue),0) -12)"}>}REV)
it is not returning error but it returns 0 which means the expression is correct but not sure why it returns 0.
Any help is appreciated
Is RDATEValue a month column?