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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nayanqlik
Partner - Creator
Partner - Creator

Show an expression based on a selection

Hi

I have expressions in a chart table and want it to show based on a selection.  I'm just struggling with the syntax in the Conditional Window. 

So I have an expression for each of the months.  They go up to Dec.

Sum({<Month = {'Jan'}>}TotalAmount)

Sum({<Month = {'Feb'}>}TotalAmount)

......

......

Sum({<Month = {'Dec'}>}TotalAmount)

I have a List box called Year Spilt. The Values are "1st Half" and "2nd Half" .  "1st Half represents months from Jan to Jun and "2nd Half" from Jul to Dec.

So If I select '1st Half", I want only the expressions  that contains Month = Jan up to Jun  should display. And if I selection "2nd Half", then the expressions containing Month = Jul up to Dec should display.  If nothing is selected, then all expressions should display.

How do I do get the correct syntax in the Conditional window.

Thank you

Kind regards

Nayan

1 Reply
jpitfield
Contributor II
Contributor II

You could do this

=GetFieldSelections([Year Split]) = '1st Half' or Len(GetFieldSelections([Year Split]))=0

however I would suggest you write a value for full year then use Match(GetFieldSelections([Year Split]),'1st Half' ,'Full Year') & Match(GetFieldSelections([Year Split]),'2nd Half' ,'Full Year') respectively

You could also write the interval values into a calendar to accomplish the same then you could use one expression and the calendar month as a dimension in your chart and filter on the field

HTH Jim