Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression for category wise aggregation

Hi everyone,

I will explain the problem with an example.

A table has 3 columns(ID, Field and Value) and the fourth column shows the desired result from expression while representing this data:

IDFieldValueValue Expected from Expression
1A11/(1+2+3)
1B100100/(100+200+300)
1C1000010000/(10000+20000+30000)
2A22/(1+2+3)
2B200200/(100+200+300)
2C2000020000/(10000+20000+30000)
3A33/(1+2+3)

3

B300300/(100+200+300)
3C

30000

30000/(10000+20000+30000)

In words, it can be put as Value / (Sum of Values from rows where field is same as field in current row).

Can somebody help me with the expression?

Thanks in advance:).

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Use below expression

SUM(Value)/SUM(TOTAL <Field> Value)

View solution in original post

2 Replies
MK_QSL
MVP
MVP

Use below expression

SUM(Value)/SUM(TOTAL <Field> Value)

Not applicable
Author

Hi Manish,

It is exactly what I wanted.

Thank you so much for your help.