Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I need to set an expression like this:
One is: if the user filter from aug 21º to sep 10º,
the other expresison needs to have the result of the same days but from the last month: jul 21º to aug 10º.
How could I do that?
e.g.
Diesel consumption:
from aug 21º to sep 10º = 21,2
set expression: jul 21º to aug 10º = 19,6
Tks
Hello, Samuel!
In set expression you can use Addmonths() function with Max() or Min() for indicating a range of output dates.
Hello, Samuel!
In set expression you can use Addmonths() function with Max() or Min() for indicating a range of output dates.
Something along this pattern:
Sum{<Date = {">=$(vMinDate) <=$(vMaxDate)"}>} Amount)
Sum{<Date = {">=$(=AddMonths(vMinDate, -1)) <=$(=AddMonths(vMaxDate, -1))"}, Month, Year>} Amount)
Assumes that the min and max are defined in the correct date format, that the fact table date field is called Date. I have also added overrides so that the date selection does not interfere with the second expression. If this does not work you will need more information to give more specific help.
Got it with this:
S_Date={'>=$(=addmonths(min(S_Date),-1))<=$(=addmonths(max(S_Date),-1))'}
Tks a lot,.
Tks for attention Jonathan.
Got it worked.
Gonna create variables to be faster.