Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Skip the ticket, Chat with Qlik Support instead for instant assistance.
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Totals not correct

Hi,

I have used pivot table but the totals are not matching.Below is the expression.

Expression:

if(sum(total_dec_app) > sum(aggr(sum(customer_id_count),store)),sum(total_dec_app) - sum(aggr(sum(customer_id_count),store)),0)

Below is the image for reference.

Untitled.png

Thanks..

7 Replies
Anil_Babu_Samineni

When you say Total is not matched, You may describe more. And then, I would recommend to share sample data and expected output which demonstrates the issue

Expression seems okay to me

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
nareshthavidishetty
Creator III
Creator III
Author

Yes the total is not matching..

PrashantSangle

Hi,

try below.

1: sum(aggr(sum(if(total_dec_app > customer_id_count,total_dec_app - customer_id_count,0),store))

or
2: if(sum(total_dec_app) > sum(aggr(sum(customer_id_count),store)),sum(aggr(sum(total_dec_app),store)) - sum(aggr(sum(customer_id_count),store)),0)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
HirisH_V7
Master
Master

Hi,

Can you post your sample data and elaborate your requirement.

I suggest to use dimensionality() for the totals fields. It will be helpful for grouping and using aggr efficiently in pivot.

-Hirish

HirisH
“Aspire to Inspire before we Expire!”
satheshreddy
Creator III
Creator III

Hi Naresh,

can you check the below EXP.

if(sum(total_dec_app) > aggr(sum(customer_id_count),store),sum(total_dec_app) - aggr(sum(customer_id_count),store),0)

Regards

Sathish

Not applicable

Hi,

It is a bad approach to use if statements in your expressions as it is killing the app performance. Looking at the expression it might work as per design.

Please create a copy of your table and remove the store dimension. Then you will likely see the subtotals as you currently see.

Also you can add two expressions to see the behavior of the complete formula.statement. Expression 1 only contains: sum(total_dec_app). expression 2 contains sum(aggr(sum(customer_id_count),store)).

Kind regards,

Matthijs

sunny_talwar

How many dimensions do you have in your pivot table? Just 1 or are there more?