Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set Analysis: Ignore User Selections

COUNT({$<TIME_Year_Month_num={$(=MAX(TIME_Year_Month_num))},TIME_Year= ,TIME_Month_Num= ,RACKER_Above_Max={$(='Y')}>}COMPA_RATIO_BIN)

I'm using this (^) expression to create a bar chart of values in COMPA_RATIO_BIN.  I only want to count and display the values in the latest month in the latest year of my data.  To identify this latest month in the latest year, I've created [TIME_Year_Month_num] which is a concatenation of the year with a 2-digit month number (e.g. for September of 2012, [TIME_Year_Month_num] = 201209).

The problem is, when I make selections in Month or Year listboxes, the data in the chart clearly changes.  By my understanding of set analysis, this shouldn't happen because I've entered

TIME_Year=

TIME_Month_Num=

Thoughts?

1 Solution

Accepted Solutions
MayilVahanan

Hi

COUNT({$<TIME_Year_Month_num={$(=MAX({1}TIME_Year_Month_num))},TIME_Year= ,TIME_Month_Num= ,RACKER_Above_Max={$(='Y')}>}COMPA_RATIO_BIN) 


Hope it helps

See the {1} in max() function.

And also try mr.rebeccad post also..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

9 Replies
Not applicable
Author

Try using a 1 instead of the $ sign

MayilVahanan

Hi

COUNT({$<TIME_Year_Month_num={$(=MAX({1}TIME_Year_Month_num))},TIME_Year= ,TIME_Month_Num= ,RACKER_Above_Max={$(='Y')}>}COMPA_RATIO_BIN) 


Hope it helps

See the {1} in max() function.

And also try mr.rebeccad post also..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Silly Mayil, I am a girl!!

Anonymous
Not applicable
Author

a) Thanks for the ultra-quick reply

b) I'd rather not use a 1 because I have other list boxes (besides year and month) that I'd like to let change the data

c) I tried using a 1 just to see what would happen.  All of the list box filters EXCEPT for year and month are ignored.  Could this somehow be due to the fact that I use month and year to define TIME_Year_Month_num in my script?

MayilVahanan

Hi

Oops. really sorry rebeccad, am from India..I didn't heard this name before.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

You can use max(TOTAL datefield) if you want it to always take the absolute max, despite what is selected.

Not applicable
Author

No problem I just thought it was funny

Anonymous
Not applicable
Author

Mayil,

Thanks.  That worked perfectly.  But can you explain what that {1} does and why it worked?

MayilVahanan

Hi mhouston00

=max({1}TimeYearNum)  holds the maximum Year n ignore any selection in the filters.

And remaining values, it change according to your selection.

For rebeccad:

.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.