Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
HermGerm
Contributor II
Contributor II

Calculate percentage of other dimensions in table

Hi,

my straight table looks like this:

Element    Value

POS1          100

POS2          50

POS3          50%

 

Element is a Dimension and the value is caluclated in an expression.

My Problem is, im not able to calculate the percentages from POS2 of POS1 and show them in Element POS3, how would be the formula there?

My Expression for the value of POS1 and POS2 is simply sum(amount)

For POS3 I was trying to pull something like this off: sum({Element={'POS2'}Amount) / sum({Element={'POS1'} Amount) but its just showing nothing (-) as a result

 

PS: The Value Expression overall looks like this:

if(Element='POS3',sum({Element={'POS2'}Amount) / sum({Element={'POS1'} Amount),sum(amount))

Any suggestions how to achieve this? I think the Problem is, that in the dataset behind, there are no amount-values for POS3, since it has to be calculated in the table based on other Element-dimension, is that right?

PPS: When working with more expressions, I remember that something like this is working =column(1)/column(2) might this be possible on a row-based-level?

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi 

this will work for you 

if(Element='POS3', num(sum(total if(Element='POS2',Value))/ sum(total if(Element='POS1',Value)),'##0.0%'), num(Sum(Value),'#,##0'))

View solution in original post

1 Reply
lironbaram
Partner - Master III
Partner - Master III

hi 

this will work for you 

if(Element='POS3', num(sum(total if(Element='POS2',Value))/ sum(total if(Element='POS1',Value)),'##0.0%'), num(Sum(Value),'#,##0'))