Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple Conditional Expression on chart

Dear all,

I have a very simple chart with only one dimension "Category" and its values are : 1,2,3,4 .

I have created a very simple chart object on which on the dimension's tab I have only the "Category" dimension and on the expression tab I want to show static numbers with the "Conditional" button enabled for each category.

For example, if Category=1 I want the expression to return 1000 , if Category=2 I want the expression to return 2000 etc.

What is the expression I should use on the conditional box in the expression tab of my chart??

Thank you all

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Perhaps, you don't need conditional expression but the main expression, like:

Dimension: Category

Expression: =Pick(Match(Category, '1', '2', '3', '4'), '1000', '2000', '3000', '4000')

Or,

If it follows a certain rule, try expression like: =Category*1000

View solution in original post

6 Replies
Yousef_Amarneh
Partner - Creator III
Partner - Creator III

can you share the example, I cannot understand your request very well.

Yousef Amarneh
tresesco
MVP
MVP

Perhaps, you don't need conditional expression but the main expression, like:

Dimension: Category

Expression: =Pick(Match(Category, '1', '2', '3', '4'), '1000', '2000', '3000', '4000')

Or,

If it follows a certain rule, try expression like: =Category*1000

Not applicable
Author

I want to show the static number 1000 only when Category==1. Category is on the dimension's tab and it's values are 1,2,3,4. In the following screenshot on the yellow box I need the expression to make the check if ( category==1)

Screenshot_1.jpg

maxgro
MVP
MVP

don't use conditional

and try with this expression

pick(wildmatch(Category, '1', '2', '3', '4'), 1000,2000,3000, 4000)

Not applicable
Author

Both answers mr tresesco and mr Massimo Grossi where correct and thank you very much for your valuable time. I hope to had the chance to mark both as correct. I wonder if anyone could inform me about any online developer guide or manual about set analysis functions and examples.

Yours sincerely,

TH

tresesco
MVP
MVP

See attched: