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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

relaitive in pivot

hi,

i have pivot with 2 diemensions, and 1 exp.

i want to add new exp, that show the reilative part from the total - hope it's understood.

how can i do it ?

see exm:

ab
first-dimsecond-dim
total100
1A1010%
2B2020%
3C3030%
4D4040%
5E


thanks'

yarin.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Sorry, i missed '(', this should work

( sum({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM({$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE]) ) /

( sum(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM(total {$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE]) )

View solution in original post

6 Replies
hic
Former Employee
Former Employee

If your expression is Sum(a) then the relative part can be calculated through Sum(a) / Sum(total a)

See more on http://community.qlik.com/blogs/qlikviewdesignblog/2013/09/09/aggregation-scope

HIC

Clever_Anjos
Employee
Employee

Sum(value) / sum(Total value)

If you need aggr by some dimension

Sum(value) / sum(Total <Dim1> value)

Anonymous
Not applicable
Author

hi,

thanks' ...my exp. go like this :

sum({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM({$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE])

HOW DO I DO IT ???

THANKS' AGIAN

YARIN

Clever_Anjos
Employee
Employee

( sum({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM({$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE]) /

sum(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM(total {$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE])

Anonymous
Not applicable
Author

hi,

i get nathing, what can be the problem ?

when i check calculte only the total rows it's o.k.

Clever_Anjos
Employee
Employee

Sorry, i missed '(', this should work

( sum({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM({$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM({$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE]) ) /

( sum(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ZIKUY])
+
SUM(total {$<_Flag={Inv,InvAdel},PFLAG={3},[KG]={">0"}>}[ROW])
+
SUM(total {$<_Flag={Inv,InvAdel},[KG]={">0"}>}[PRICE]) )