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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Summarize values for a list box filter

Hi,

I have a field in a table box that deals with percentage values, which can be anything from 0-100. In my filter listbox, I would like to summarize them:

0-19%

20-39%

40-59%

60-79%

80-100%

I solved this with this expression:

=if(OPPORTUNITY.OPPORTUNITY_PROBABILITY >= 0 and OPPORTUNITY.OPPORTUNITY_PROBABILITY < 20, ' 0 - 19%',if(OPPORTUNITY.OPPORTUNITY_PROBABILITY >=20 and OPPORTUNITY.OPPORTUNITY_PROBABILITY < 40, '20 - 39%', if(OPPORTUNITY.OPPORTUNITY_PROBABILITY <=40 and OPPORTUNITY.OPPORTUNITY_PROBABILITY < 60, '40 - 59%', if(OPPORTUNITY.OPPORTUNITY_PROBABILITY >=60 and OPPORTUNITY.OPPORTUNITY_PROBABILITY < 80, '60 - 79%', '80 - 100%'))))


Problem is, that when I select one of these regions, the Current selections  box does not show e.g. '0-20%', but 10, 12, 19 as listed values. How can change this? And is there a better way to create the summary than using that ugly if-statement?


Thanks

Jens

1 Solution

Accepted Solutions
sudeepkm
Specialist III
Specialist III

You can keep this code in your load script and create a new field like OPP_PROB.

Please take a look at the example.

View solution in original post

3 Replies
sudeepkm
Specialist III
Specialist III

You can keep this code in your load script and create a new field like OPP_PROB.

Please take a look at the example.

MK_QSL
MVP
MVP

Try to use class function.

Please check enclose file...

Not applicable
Author

I already implemented the version from Sundeep, but I will check yours, too, for sure. Although I have to admit that I never worked with the Class function.