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: 
er_mohit
Master II
Master II

Pivot Chart Total - Calculation

Hello friends.

I am stuck off while doing calculation in pivot chart.

Please find below the table details with output. I have a table like this

LOAD * Inline [

ID,SubId,SubId2,Sale,sale,Stock

1001,a,a1,20,40,10

1001,b,b1,-20,40,60

1001,c,c1,30,40,60

1002,d,d1,30,60,70

1002,a,a1,40,60,80

1003,z,z1,-50,40,90

];

On front side i am creating pivot table.

Used one expression : (sum(Sale)+sum(sale))-sum(Stock) -  Total Sale

Now I want output like this :

   

IDSubIdSubId2Total Sale
1001aa150
1001bb1-40
1001cc110
1001Total 60
1002aa120
1002dd120
1002Total 40
1003zz1-100
1003Total

Here what i want to show in Total field ignore negative values consider only positive while doing totalling and if there is only negative value then total field should be null.

I am using dimensionality() function to do the same but not getting the desired result.

Please find attachment also.

Any help will be appreciable.

Regards

Mohit

12 Replies
PrashantSangle

Hi,

Well It was just suggestion. If particular field not necessary then avoid it.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
sunny_talwar

Agreed

er_mohit
Master II
Master II
Author

Thanks