Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Hassan1
Partner - Contributor
Partner - Contributor

how to choose a column in a measure based on dimension level Qlik Sense

Hi all,

I would like to calculate a measure based on the dimension level in the pivot table

I Have 4 levels for Target that they do not roll-up; Meaning aggregation lower Level do not match with Upper levels

Level1

    Level2

        Level3

               Level4

if the dimension is Level1 the Sum(Column1), If the dimension is Level2 then sum(Column2), if the Dimension is Level3 then Sum(Column3), if the Dimension is Level3 then Sum(Column4)

 

 

1 Solution

Accepted Solutions
Jacek
Educator-Ambassador
Educator-Ambassador

If you want to have all calculations in one column you can try this pick function:

=pick(Dimensionality(), Sum(Sales), Sum(Sales2),  Sum(Sales3), Sum(Sales4) )

or constant calculations for each level:

=pick(Dimensionality(), Sum(total <Product> Sales), Sum(total <Month> Sales))

View solution in original post

3 Replies
Hassan1
Partner - Contributor
Partner - Contributor
Author

Level1                                                        Sum(Column1)

    Level2                                                    Sum(Column2)

        Level3                                                Sum(Column3)

               Level4                                         Sum(Column4)

Jacek
Educator-Ambassador
Educator-Ambassador

If you want to have all calculations in one column you can try this pick function:

=pick(Dimensionality(), Sum(Sales), Sum(Sales2),  Sum(Sales3), Sum(Sales4) )

or constant calculations for each level:

=pick(Dimensionality(), Sum(total <Product> Sales), Sum(total <Month> Sales))

Hassan1
Partner - Contributor
Partner - Contributor
Author

Thanks great it works