Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

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
Highlighted
Partner
Partner

Re: Show an expression based on Selection

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
Highlighted
Partner
Partner

Re: Show an expression based on Selection

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

Highlighted
Master
Master

Re: Show an expression based on Selection

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.

Highlighted
Creator
Creator

Re: Show an expression based on Selection

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

Highlighted
Partner
Partner

Re: Show an expression based on Selection

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

Highlighted

Re: Show an expression based on Selection

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.

Highlighted
Master
Master

Re: Show an expression based on Selection

I wondered too

Highlighted
Creator
Creator

Re: Show an expression based on Selection

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

Highlighted

Re: Show an expression based on Selection

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