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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis

Hi,

I am trying to write a set analysis expression like below:

=Sum({<FIS_CAL_WEEK_ID ={">=Max(FIS_CAL_WEEK_ID)-12 <=Max(FIS_CAL_WEEK_ID))"}>} TOTAL_QTY)

The objective sum of Total Quantity where it will start from Maximum week number and will show only 13 weeks in the chart.

Thanks

1 Solution

Accepted Solutions
maxgro
MVP
MVP

Sum( {$<FIS_CAL_WEEK_ID = {">=$(=Max(FIS_CAL_WEEK_ID)-12)<=$(=Max(FIS_CAL_WEEK_ID))"} >} TOTAL_QTY)

View solution in original post

10 Replies
Sokkorn
Master
Master

Hi Simky,

Try this

=Sum({<({<FIS_CAL_WEEK_ID = {">=$(=Max(FIS_CAL_WEEK_ID)-12)<=$(=Max(FIS_CAL_WEEK_ID))"} >} TOTAL_QTY)

Regards,

Sokkorn

maxgro
MVP
MVP

Sum( {$<FIS_CAL_WEEK_ID = {">=$(=Max(FIS_CAL_WEEK_ID)-12)<=$(=Max(FIS_CAL_WEEK_ID))"} >} TOTAL_QTY)

Not applicable
Author

Hi Simky,

I've not tested this but I hope it works. I have recently done something similar to create a rolling 12 months. What I will suggest including in your set analysis is ignoring selections on other date fields. In the example below I have added "FIS_YEAR=," to demonstrate what I mean:

=SUM({<FIS_YEAR=, FIS_CAL_WEEK={">=$(=Max(FIS_CAL_WEEK_ID)-12)<=$(=Max(FIS_CAL_WEEK_ID))"}>} TOTAL_QTY)

Regards,

Chris

Not applicable
Author

This expression is working, thanks for the help

Not applicable
Author

What is reason of adding other fields? If I have 10 ffilters in a dashboard, do I need to add all?

Not applicable
Author


try this

=Sum({<({<FIS_CAL_WEEK_ID = {'>=$(=Max(FIS_CAL_WEEK_ID)-12)<=$(=Max(FIS_CAL_WEEK_ID))'} >} TOTAL_QTY)

Not applicable
Author

Hi Simky,

If you want to ignore all the selections for all 10 filters, it is better to do like this:

= SUM ({1 <FIS_CAL_WEEK={"> = $ (= Max (FIS_CAL_WEEK_ID) -12) <= $ (= Max (FIS_CAL_WEEK_ID)) "}>} TOTAL_QTY)

Constant 1 - represents the full set of all the records in the application.

maxgro
MVP
MVP

if possible, when you ask a question and you get an answer that proves right to you, mark as helpful or answer, thanks

Not applicable
Author

Sure. I have marked your correct answer.