Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to build an expression in a bar chart where I want to calculate the difference between today's values and yesterday's. I'm using a date dimension called period. So I thought I could write something like this:
sum(value) - sum({<period = {period -1}>}value)
...but then I get an "Error in set modifier ad hoc element list" error.
Any ideas on what the problem is and how to solve it are very welcome.
Thanks,
Uzi
sum({<period = {"=$(date(today()))"}>}value) - sum({<period = {"=$(date(today() - 1))"}>}value)
Assuming that period field is in Date format. if not make it the same format as Date.
-Nilesh
Hi
You cannot use a set expression related to the dimension value. The expression is evaluated outside of the context of the dimensions. Use Above() to compare a value with previous value in chart. This should do the trick:
Sum(Value) - Above(Sum(Value))
HTH
Jonathan
Hi Uzi
just a metter of syntax
sum({<period = {"=$(period -1)"}>}value)
in this case period is selected value. To change it as today
sum({<period = {"=$(today()-1)"}>}value)
you can also set a variable in your script or parameters as vToday = today(), vYesterday = today()-1
best regards
Chris