Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I display data depending on condition?

Hi

I have a table that contains a Customer_Type_ID field with the numbers 1 to 5, and another field called 'Grouping'.

I would like to display a pie chart that shows data where the customer_type_id is not equal to '1'.  How do I set this condition in the Expression tab?

Please help.

Many thanks

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

take a pie chart

in dimension write

if(Customer_type_ID<>1,Customer_type_ID)

and supress null( check the checkbox)

in dimension

write

Count(Grouping)

Sunil Chauhan

View solution in original post

9 Replies
Miguel_Angel_Baeyens

Hi,

Say you want to show the sum of Sales for all groups except for the "1". The expression would be

Sum({< Customer_Type_ID -= {1} >} Sales)

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

rahulgupta
Partner - Creator III
Partner - Creator III

Can u send a sample Data.

also clarify ur requirmnts.

Not applicable
Author

Hi Miguel

thank you but that didn't work.  I will attach a sample of the spreadsheet to make it clearer.

Miguel_Angel_Baeyens

Hi,

The attached data doesn't have transactions, so I cannot sum or aggregate values. The only difference from my code above is taht, as you know, QlikView is case sensitive for both field names and values, and I typed Customer_Type_ID instead of Customer_type_ID (note the lowercase "t" in "type").

So this expression should work

Sum({< Customer_type_ID -= {1} >} Sales)

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

SunilChauhan
Champion II
Champion II


Please try attached file

Sunil Chauhan
Not applicable
Author

Hi Sunil

Thank you but, it won't let me open it because I am using a Personal Edition License.

SunilChauhan
Champion II
Champion II

take a pie chart

in dimension write

if(Customer_type_ID<>1,Customer_type_ID)

and supress null( check the checkbox)

in dimension

write

Count(Grouping)

Sunil Chauhan
Miguel_Angel_Baeyens

Hi,

As a general rule, I try to avoid calculated dimensions whenever possible, because they perform extremely poor. When the data volume is higher than a few thousands of lines, the rendering of the chart takes considerably longer using a calculated dimension instead of a set analysis expression (or even a conditional expression).

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Thanks Sunil.  It worked with your suggestion.

Miguel - I will bear your 'general rule' in mind.  Thanks for the heads up.