Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot chart sub total conditions

Hi

In Pivot chart, I have dimension (location,item) , expressions(quantity,value). Here, I have value but quantity is zero for some items. I need to cut this value when quantity is zero. after that sub total(show partial columns - by checked) is having the total value(including value of zero quantity). So please give me suggestions.

my expression for Qunatity is == sum(PQTY-MQTY)

my expression for Value is == sum(PSTOCKVALUE-MSTOCKVALUE)

Expecting your reply.

Location         Item                 Qty           Value

Stores            Apple              5                   10

                     orange             12                  15

                       banana           0                    3

                       grapes            0                     2

                      pineapple          2                   6

                      total                19                  36

i need           

                      total                19                  31

Thanks

Kumar

16 Replies
Not applicable
Author

Hi,

If you need to show as below:

Location         Item                 Qty           Value

Stores            Apple              5                   10

                     orange             12                  15

                     pineapple          2                   6

                      total                19                  31

Use these Expressions:

Qty:sum(if(PQTY-MQTY>0,PQTY-MQTY))

Value:sum(if(PQTY-MQTY>0,PSTOCKVALUE-MSTOCKVALUE))

hope this helps you...!

rohit214
Creator III
Creator III

hi

try this

in Script:

if(Qty=0 0r isnull(Qty='-1'),'0','1') as Flag

in expression:

sum(Qty*Flag)

Sum(Value*Flag)

may it hepls you

thanks

rohit

Not applicable
Author

where should i give this FLAG option

its_anandrjs

Hi,

You have to use

Qunatity is ->  =sum(PQTY-MQTY)

Value is -> IF( sum(PQTY-MQTY) = 0, 0 , sum(PSTOCKVALUE-MSTOCKVALUE) )

Rgds

Anand

Not applicable
Author

still same answer is coming

sum of rows are not equal to total value

its_anandrjs

Hi,

See the attached sample file

Let me know about this.

Rgds

Anand

Not applicable
Author

hi

in straight table it is showing correct. please try in Pivot chart.

thanks

kumar

Not applicable
Author

Hi,

see the attached file ,it is working fine.

its_anandrjs

HI,

See the attached it is working for both 

Rgds

Anand