Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show an expression based on 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 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

HI

GetFieldSelections([Year Split]) = '1st Half' Or GetSelectedCount([Year Split]) = 0

GetFieldSelections([Year Split]) = '2nd Half'Or GetSelectedCount([Year Split]) = 0


Mark

View solution in original post

8 Replies
Mark_Little
Luminary
Luminary

Hi,

In the Conditional box you want

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

GetFieldSelections([Year Split]) = '2nd Half'


This is on the Conditional box on the expressions tab.


Mark

shiveshsingh
Master
Master

You need to put below conditions in layout tab for conditional visibility

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

GetFieldSelections([Year Split]) = '2nd Half'


I hope when you select '1st Half' in listbox, then only jan-jun data is visible. i.e. mapping is already present for 1st half and months.

Anonymous
Not applicable
Author

Hi Mark

Thank you for your reply.  Just one issue, if nothing is selected, I want all months to show.  At the moment this is not the case.

Kind regards

Nayan

Mark_Little
Luminary
Luminary

HI

GetFieldSelections([Year Split]) = '1st Half' Or GetSelectedCount([Year Split]) = 0

GetFieldSelections([Year Split]) = '2nd Half'Or GetSelectedCount([Year Split]) = 0


Mark

sunny_talwar

I wonder why you don't use a pivot table instead of using 12 expressions? You can use Month as a dimension and then use Sum(TotalAmount) as an expression.

shiveshsingh
Master
Master

I wondered too

Anonymous
Not applicable
Author

Hi Sunny

Thanks for the tip.  Reason why is that I have other expressions in addition to Sum(Total Amount) where i don't require values per month.

Kind regards

Nayan

sunny_talwar

There are ways around that in the pivot table, but that's a different topic... I am glad you got what you wanted.

Best,

Sunny