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

% of total with two dimensions

Hi there,

I managed to create an expression in which the Treemap shows the % of 'Picing Group' per 'Quote Type'.

The expression works well as long as i don't select a Pricing Group. As soon as I do select one, the % goes up to 100% for all Quote Types, which should not be the case.

Appreciate any assistance in getting this expression to display the correct % when a Pricing Group is selected.

clipboard_image_1.png

=If(GetSelectedCount([Week Num])=0,
sum({<[Week Num]={$(=Week(Today())-1)}>} TEU)/sum({<[Week Num]={$(=Week(Today())-1)}>} total <[Quote Type]> TEU)
,Sum(TEU)/Sum(total <[Quote Type]> TEU))

clipboard_image_0.png

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

To be precise, try this

=If(GetSelectedCount([Week Num]) = 0,

  Sum({<[Week Num] = {$(=Week(Today())-1)}>} TEU)
  /
  Sum({<[Week Num] ={$(=Week(Today())-1)}, [Pricing Groups]>} TOTAL <[Quote Type]> TEU),

  Sum(TEU)
  /
  Sum({<[Pricing Groups]>}TOTAL <[Quote Type]> TEU)

)

View solution in original post

4 Replies
Fabien
Contributor III
Contributor III
Author

Help anyone? 😞

Channa
Specialist III
Specialist III

you need to exclude selection

 

=sum ( total {<Pricing Group= >} TEU)

 

 

Channa
sunny_talwar

To be precise, try this

=If(GetSelectedCount([Week Num]) = 0,

  Sum({<[Week Num] = {$(=Week(Today())-1)}>} TEU)
  /
  Sum({<[Week Num] ={$(=Week(Today())-1)}, [Pricing Groups]>} TOTAL <[Quote Type]> TEU),

  Sum(TEU)
  /
  Sum({<[Pricing Groups]>}TOTAL <[Quote Type]> TEU)

)
Fabien
Contributor III
Contributor III
Author

Thank you both for your responses.

It works great!! 🙂