Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I've a typical problem of YTD.
My user have the ability of filtering the Year, Month and Day of Sales Revenue.
The question is that I cannot show the YTD value when a Month or a Day is filtered because the YTD values excludes all other months.
I have this Sum Expression:
SUM({$<Year={$(LAST_WORKDAY_REPDATE_VAR)}>}Sales)
Where LAST_WORKDAY_REPDATE_VAR is a variable that holds the Year of a Calendar selection, but I can't get no results from this expression.
Thanks in advance for your help.
Mário
The first $ in your expression is telling it to include all selections. So you're explicitly telling it to include the Month and Day selections when doing the sum. Instead, you need to tell it to IGNORE the month and day selections (as well as any other fields that are in your calendar). Something like this:
sum({<Month=,Day=,Year={$(LAST_WORKDAY_REPDATE_VAR)}>} Sales)
Another thing you need to make sure of is that the Year field and the LAST_WORKDAY_REPDATE_VAR are formatted the same, as set analysis appears to do a text rather than numeric comparison.
The first $ in your expression is telling it to include all selections. So you're explicitly telling it to include the Month and Day selections when doing the sum. Instead, you need to tell it to IGNORE the month and day selections (as well as any other fields that are in your calendar). Something like this:
sum({<Month=,Day=,Year={$(LAST_WORKDAY_REPDATE_VAR)}>} Sales)
Another thing you need to make sure of is that the Year field and the LAST_WORKDAY_REPDATE_VAR are formatted the same, as set analysis appears to do a text rather than numeric comparison.
Thank you very much!!
Great TIP!
Can you help me in another question related to this?
I have a calendar and I have mapped, as you say, and it is working almost perfectly:
sum({<Data=, Month=,Year={$(=(Year))}>} Sales)
The only problem is this: If the use selectes the Date: 05-08-2009, I want to show the YTD value until that date, and not until today.
I've changed the expresion to this:
sum
({<Data<={$(Data)}, Month=,Year={$(=(Year))}>} Quantidade)But I can't get the desired results.
Thanks for all your help