Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying display sale for YeartoDate(YTD) for last year.. but when i check totals with source i am getting wrong number
i guess month variable is wrong ... can some one correct me
here is my expression
sum({$<Year = {$(vLastYear)}, Month = {"<=$(vThisMonth)"}>} Sales)
Hard to say what is going wrong here, but one thing that you should check:
If the user can make selections in other calendar table fields like Date, you need to clear all these fields in the set expression:
=sum({$<Year = {$(vLastYear)}, Month = {"<=$(vThisMonth)"}, Date= >} Sales)
How are the variables defined?
LET vToday = vMaxDate;
LET vThisYear = year($(vToday));
LET vLastYear = year($(vToday)) - 1;
LET vThisMonth = num(month($(vToday)));
LET vLastMonth = num(month(addmonths($(vToday), -1)));
but when i use below expression i get correct results
sum(if(FPYTD, Sales))
where FPYTD is obtained by expression inyeartodate(D, $(vToday), -1) * -1 AS FPYTD,
Since the two different tests in your expression have slightly different syntax I would try testing each part:
sum({$<Year = {$(vLastYear)}>} Sales)
sum({$<Month = {"<=$(vThisMonth)"}>} Sales)
I would use:
sum({$<TransDate = {'<$(vThisMonthLastYearStart)'}>} Sales)
with:
LET vThisMonthLastYearStart = date(monthstart(addyears($(vToday),-1)));
Hi
Can u please attach sample app