Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum with set analysis

Hi,

I have the following expression: sum(AVAIL_1)/sum(AVAIL_2)

the result of this expression bring to me the sum of all avails from all weeks, but I need to filter just the avails of the last four weeks (SEMANA)

i wrote the following:

sum({< SEMANA = {'>$(=max(SEMANA) - 4'}>} AVAIL_1)/sum({< SEMANA = {'>$(=max(SEMANA) - 4'}>} AVAIL_2))


but doesn't works.


How can I fixe this?

Thank you!



Labels (1)
2 Replies
salto
Specialist II
Specialist II

Hi Rafael,

this works for me:

sum({< SEMANA = {">=$(=(Max(SEMANA) - 4))"}>} AVAIL_1)

/

sum({< SEMANA = {">=$(=(Max(SEMANA) - 4))"}>} AVAIL_2))


Hope this helps!

javier_florian
Creator III
Creator III

You can try with this:

=Sum({<Semana={">=$(=Num(Max(Semana))-2)<=$(=Num(Max(Semana)))"}>} Avail_1)

/

Sum({<Semana={">=$(=Num(Max(Semana))-2)<=$(=Num(Max(Semana)))"}>} Avail_2)

Regards,

- Javier Florian