Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Button Action to show only selected Color Limit Expressions

I have this expression in a straight table and Color assigned to the Text based on my limits:

 

if(Sum(Expense)<5, Red(),

if(Sum(Expense)>=5 and if(Sum(Expense)<=10, Green(),

if(Sum(Expense)>10, Yellow()))

 

I need to create buttons to select these conditions.

Clicking Button1 should only show rows with Red color

Clicking Button2 should show rows with Green and clickign Button3 should show rowns only with Yello.

 

How do I do this?

Labels (2)
3 Replies
dplr-rn
Partner - Master III
Partner - Master III

dont know your full context but you could try soemthing like below

 variables per color e.g. vShowRed ,vShowGreen, vShowYellow

buttons will toggle variables between 1 (show) and 0

then your dimension declare using the an expression like below

if(Sum(Expense)<5 and $(vShowRed )=1, DIMENSION,

if(Sum(Expense)>=5 and Sum(Expense)<=10 and $(vShowGreen)=1, DIMENSION,

if(Sum(Expense)>10 and and $(vShowYellow)=1, DIMENSION))

show when null should be turned off.

 

please note if conditions can degrade performance (especially if data size is high). if possible try to move the conditions to set analysis or the script. need more detail to judge if it can be

 

qlikwiz123
Creator III
Creator III
Author

Doing this at Dimension level gives out 'Error in Calculation' even though it is correct.

Brett_Bleess
Former Employee
Former Employee

Will likely be most helpful if you can attach an example QVW which has the setup and your expected output.  I believe the other option would be to use Actions to make the selections based upon the expression though, here is Help link regarding Actions:

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Button2.htm#anc...

Not exactly sure how to make this work, but hopefully this may give you another approach to try.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.