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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Value adding to other columns

Hi I have a pivot chart and and my issue is Period - P0 value need to add to other Periods

Expr -

sum (Value)

Current Chart

Dim1 Dim2  Dim3 Dim4(Period) :  P0   P1   P2   P3

A       X           TT                        10   20   25   40 

B       Y           ZZ                         2    5      8     7

And The requirement is:

Dim1 Dim2  Dim3 Dim4(Period) :  P0   P1                 P2                P3

A       X           TT                        10   30(P0+P1)     35(P0+P2)     50  (P0+P3)

B       Y           ZZ                         2    7                   10                 9

Note - Dim4(Period) is dragged upwards.

Thank you

1 Solution

Accepted Solutions
priyarane
Specialist
Specialist
Author

Hi Guys,

I got the answer with the help of 'http://community.qlik.com/thread/151035'

and the answer like below -

sum

(Value)
+
if(Trad_PERIOD='P0',0,sum(TOTAL <Dim1, Dim2, Dim3> {<PERIOD={'P0'}>} Value))

Thank you all.


View solution in original post

7 Replies
Anonymous
Not applicable

Hi Priya,


//initialize a variable for sum of P0 in script and try like this

LET varP0 = Peek('FieldName',0,Temp);

In chart:

if(Product='P0',sum(Value),sum(Value)+$(varP0))

Regards

Neetha

MK_QSL
MVP
MVP

Instead of using Period in Dimension tab... create below 4 expressions in Expression Tab

Expression

SUM({<Period = {'P0'}>}Value)

Lable

P0

Expression

SUM({<Period = {'P0'}>}Value) + SUM({<Period = {'P1'}>}Value)

Label

P1

Expression

SUM({<Period = {'P0'}>}Value) + SUM({<Period = {'P2'}>}Value)

Label

P2

Expression

SUM({<Period = {'P0'}>}Value) + SUM({<Period = {'P3'}>}Value)

Label

P3

sunny_talwar

Did you look at this similar post?

Chart Caluclation

and

Setanalysis to make field constant

Best

S

priyarane
Specialist
Specialist
Author

Hi Manish,

I have tried it but the issue is, if we select Period(Filter) then for Ex- P1 then still we can see all periods.

Not applicable

Hi,

could you please attached an example qvw?

priyarane
Specialist
Specialist
Author

Hi SunIndia,

Its similar kind of 'http://community.qlik.com/thread/151035'

priyarane
Specialist
Specialist
Author

Hi Guys,

I got the answer with the help of 'http://community.qlik.com/thread/151035'

and the answer like below -

sum

(Value)
+
if(Trad_PERIOD='P0',0,sum(TOTAL <Dim1, Dim2, Dim3> {<PERIOD={'P0'}>} Value))

Thank you all.