Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Referencing in a expression the result of a calculated dimension (ValueList)

Hi Forum,

I am facing a problem to reference in the expression formula the result of my 'manual' value list.
The issue is as follows:

Simple Table
- Dimension 1 = Customer
- Dimension 2 = ValueList('Turnover','GrossProfit','Weight')

Expression1 should be something like
- IF Dimension2 = 'Turnover' THEN SUM(Turnover), IF Dimension2 = 'GrossProfit' THEN SUM(GrossProfit), ELSE SUM(Weight)

This would give me the flexiblity to show multiple fields with different content under each other. As a sample the result would look like underneath, consindering we have single customerA only. There are 3 different fields which are representing column A.

Dim1 Dim2 Expression 1 (Used Fields based on Dim2)
CustomerA Turnover 1000
CustomerA GrossProfit 50
CustomerA Weight 800

I do not know how to link in my Expression1 the value from the ValueList from the Dimension2.
Appreciate your help on the syntax for the formula in Expression1.

1 Solution

Accepted Solutions
pat_agen
Specialist
Specialist

hi Markus,

the help manual states the following:

Returns a set of listed values which, when used in a calculated dimension, will form a synthetic dimension. In charts with a synthetic dimension created with the valuelist function it is possible to reference the dimension value corresponding to a specific expression cell by restating the valuelist function with the same parameters in the chart expression. [...]

so try this as your expression

if(ValueList('Turnover','GrossProfit','Weight')='Turnover',SUM(Turnover),
if(ValueList('Turnover','GrossProfit','Weight')='GrossProfit',SUM(GrossProfit),SUM(Weight))

View solution in original post

2 Replies
pat_agen
Specialist
Specialist

hi Markus,

the help manual states the following:

Returns a set of listed values which, when used in a calculated dimension, will form a synthetic dimension. In charts with a synthetic dimension created with the valuelist function it is possible to reference the dimension value corresponding to a specific expression cell by restating the valuelist function with the same parameters in the chart expression. [...]

so try this as your expression

if(ValueList('Turnover','GrossProfit','Weight')='Turnover',SUM(Turnover),
if(ValueList('Turnover','GrossProfit','Weight')='GrossProfit',SUM(GrossProfit),SUM(Weight))

Not applicable
Author

Excellent.
Works perfect.

Hero -> you. Tx a lot.