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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
raghavsurya
Partner - Specialist
Partner - Specialist

changing expressions dynamically

Hi All,

We have a requirement wherein the columns in a straight table chart should be shown only when selected. For example

Revenue QTR 1 QTR2 QTR3 QTR4 YTD

Sales 2500 2800 3200 2500 11000

Services 1500 2500 1500 2500 8000

If I click on QTR1 in list box provided, the table should show only QTR1 and other columns should not be shown, Also if I select 2 values in listbox like say QTR1 and QTR2 , columns for these two quarters should only be shown.

I tried giving condition in the Presentation tab for each of the column (Q1, Q2, Q3 and Q4) as

GetFieldSelections(Qtr)= "Q1"...... it works if I select only Qtr-1 is selected. If I select any other quarter along with Qtr-1 this condition is not working.

Can somebody help me how to achieve it.

Regards,

Raghav

1 Solution

Accepted Solutions
raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi,

This exactly addresses the required functionality. Thanks a lot.

Regards,

Raghav

View solution in original post

6 Replies
Miguel_Angel_Baeyens


raghavsurya wrote:GetFieldSelections(Qtr)= "Q1"...... it works if I select only Qtr-1 is selected. If I select any other quarter along with Qtr-1 this condition is not working.


Hi,

One way to do this would be using match() in addition to getfieldselections() as conditional

Match(GetFieldSelections(Qtr), 'Q1', 'Q2', 'Q3', 'Q4')


Where "Q1", "Q2" and so are the values of the field "Qtr".

Hope that helps

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi Miguel,

I have tried using the Match option as suggested by you. But I am not getting the desired functionality. I am attaching a sample application for your reference. Can you please help.

Regards,

Raghav

Anonymous
Not applicable

Why not simply add Qtr as dimension, turn the table into a pivot table with Qtr pivoted horizontally. Then remove all expressions and add only Sum(Amount). Now if you select any Quarters in the listbox, these will be the only ones displayed in the chart.

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi Johannes,

We want to replicate this functionality to Profit and Loss account , Balance sheet and other schedules. To convert Qtr into dimension will not help us in depicting the data in a pre-fixed format as required by Law.

Hence we are trying to give a condition to the column. Any suggetion in this matter will help us a lot.

Regards,

Raghav

Not applicable

Hi,

Instead of Match() use wildmatch() function because when we select more than 1 value in a listbox getfieldselections(Field) will give the result like Value1,Value2.

Give wildMatch(GetFieldSelections(Qtr), '*Q1*') for Quarter1 column and wildMatch(GetFieldSelections(Qtr), '*Q2*') for Quarter2 and in the same way for Q3 and Q4.

raghavsurya
Partner - Specialist
Partner - Specialist
Author

Hi,

This exactly addresses the required functionality. Thanks a lot.

Regards,

Raghav