Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys, i need your help with the next expression:
I want to sum all the sales of the week from the past year, considering the year and week that i have selected on my filters.
To get a week before of the current year, im using this expression. I guess i would have to add some "Year -1" in some place, but i can't get to the answer.
sum({ $<[Week]={$(=only([Week])-1)}> } Sales)
I appreciate your help.
Regards.
May be this:
Sum({$<[Week]={$(=Only([Week])-1)}, Year = {$(=Max(Year) - 1)}>} Sales)
Alternatively try this:
Sum({<Year, Week, Date = {"$(='>=' & Date(AddYears(Max(Date) - 14, -1), 'DateFieldFormatHere') & '<=' & Date(AddYears(Max(Date) - 7, -1), 'DateFieldFormatHere'))"}>}Sales)
May be this:
Sum({$<[Week]={$(=Only([Week])-1)}, Year = {$(=Max(Year) - 1)}>} Sales)
Alternatively try this:
Sum({<Year, Week, Date = {"$(='>=' & Date(AddYears(Max(Date) - 14, -1), 'DateFieldFormatHere') & '<=' & Date(AddYears(Max(Date) - 7, -1), 'DateFieldFormatHere'))"}>}Sales)
Perfect, that was the answer!! thank you very much!!