Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setanalysis con 2 condiciones

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.

1 Solution

Accepted Solutions
sunny_talwar

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)

View solution in original post

2 Replies
sunny_talwar

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)

Not applicable
Author

Perfect, that was the answer!! thank you very much!!