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

show condition based on selected value

Looking to conditionally show an object based on a selected value in a field. For example, if the user selects "Total Cost" (variable) then I want to show the objects related to Total Cost. The variable in this case is not associated with any of the data...it's merely used to give control to object visibility.

Thanks,

Kevin

9 Replies
pkelly
Specialist
Specialist

Apologies if I have picked up the wrong thread....

I use buttons then, when these are clicked, set a variable which I then in turn use to show specific charts.

For example, I have a variable labelled "varReportView".

Have two buttons....Detail and Summary

When detail is clicked, varReport View is updated tp "Detail".

When summary is clicked, varReport View is updated tp "Summary"

If you are pre version 9, you will need to do this via a macro..

'===========================================================================

Sub btnDetailed

set v = ActiveDocument.Variables("varReportView")

v.SetContent "Detailed",true

End Sub

'===========================================================================

If you are on Version 9, you can do this via the buttons Actions tab.

Add | External | Set Variable

In variable box, type in the variable name (varReportView in my example)

In the value box type in the value you want (Detail in my example).

If you then go to your charts properties and go to the layout tab, select Show Conditional...if you then type...

varReportView = 'Detail'

The chart will only show when the variable varReportView = 'Detail'

Hope this helps...

pkelly
Specialist
Specialist

I have added an example qvw which may be better than my ramblings....

Not applicable
Author

Or you can create a dynamic chart like this http://community.qlik.com/media/p/91101.aspx

Not applicable
Author

Thanks Paul...this is helpful!

Kevin

johnw
Champion III
Champion III

I'd avoid macros due to the various issues that accompany them. Even if you're on 9.0 and can use actions, it's easier to just use a field value, set it to always one value selected, and check the field value in the condition. The attached is Paul's example massaged to be how I would handle it.

pkelly
Specialist
Specialist

I only started to use the solution which John has posted a week or so ago and do like it but have found myself using a mixture of the two depending upon the report I am doing and the look that I want to achieve...

Not applicable
Author

Thanks John...that's exactly what I was looking for. I just wasn't sure of the syntax for the show condition.

Kevin

nathanfurby
Specialist
Specialist

Of course you can also easily achieve the button 'effects' that Paul was after but using John's technique. See attached.

pkelly
Specialist
Specialist

Thanks Nathan

Will certainly be using this method as I find that the variable route that I had been using in version 8 has suddenly become sticky in version 9....