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: 
Not applicable

How to use a different expression for each element of a dimension

Hi, as stated in the subject, can anyone teach me how to use a different expression for each element of a dimension.

For example, my stacked bar graph has two dimensions first is YEAR, 2nd is CUSTOMERS. I would like to apply a different expression for each element in the dimension - YEAR (i.e., an expression for 2008, 2009 and 2010). Note, the 2nd dimension - CUSTOMERS is being stacked for each year.

I need to learn the above because within my expression I would like to divide by a variable that differs between each year (has a different sum for each year), here is the code for my stacked bar graph expression:

=

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare08

(where MarketShare08 is a variable, and I want to use MarketShare09 and MarketShare10 for the different years)





THANK YOU SO MUCH!!!

1 Solution

Accepted Solutions
Not applicable
Author

HI,

try this:

pick(match(Year,'2008','2009','2010'),

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare08,

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare09,

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare10)

best regards!

View solution in original post

3 Replies
Not applicable
Author

HI,

try this:

pick(match(Year,'2008','2009','2010'),

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare08,

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare09,

SUM({$<[REPORT LEVEL]={'3RD PARTY'}>}TONNES)/ MarketShare10)

best regards!

Not applicable
Author

Hi,

I tried your solution, but doesn't work? You wanted me to paste that as the expression of the chart?

Not applicable
Author

O, nevermind. It does work! (I forgot to change the syntax for the field name 'Year' to 'YEAR'). Thank you so much. Your help is truly appreicated!