Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zarmoton
Creator
Creator

Netting ... How to collapse / expand in pivot table base on condition

Hello

Not easy !!  please can you help me on this complex (for me !!) problem :

i have the following data

idZoneWayQtyprice
1000A110020
1001A15021
1002A-12028
1003B-120050
1004B120055
1005C13020
1006C17020
1007C-110020
1008D15025
1009D-17512

on the simple pivot table we can have

on a simple pivot table we have
Qty_NetPrice_Net
sum(way*qty)sum(way*qty*price)
A1302490
B01000
C00
D-25350

and i would like to be able to see:

ZoneidQty_NetPrice_Net_avg
A013019.15<-- Grouping because  Qty_net > 0 and price_net > 0
B1003-20050<-- No grouping, because qty_net = 0 (see in B20)
B100420055
C000<-- No detail because Qty_net =0 and Price_net = 0
D10085025<-- No grouping, because price_net / qty_net <  0 (350/-25)
D1009-7512

My problem is how to collapse and do sum depending on condition

thank you for your help.

Warm Regards

1 Solution

Accepted Solutions
Not applicable

Laurent,

I usually do this with scripting and setting flags versus complex expressions.

Is this what you are looking for?  I have attached sample app with script.  Let me know if this helps

Net.png

View solution in original post

5 Replies
Not applicable

Laurent,

I usually do this with scripting and setting flags versus complex expressions.

Is this what you are looking for?  I have attached sample app with script.  Let me know if this helps

Net.png

zarmoton
Creator
Creator
Author

First Thank you for your help

Probably very useful

But i don’t see your script ….

Can you attach your qvw ?

thk you again

Regards,

zarmoton
Creator
Creator
Author

First Thank you for your help

Probably very useful

But i don’t see your script ….

Not applicable

sorry, adding now

zarmoton
Creator
Creator
Author

Thk yu

Very useful