Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
penpayom
Contributor
Contributor

Help me please__Why is the answer in the regular table not equal to the Pivot table?

Help me please

Why is the answer in the regular table not equal to the Pivot table?

This my code in Expression Pivot table

=aggr(sum(DISTINCT(Fabric_QTY)*(ITEM_CONTAIN)/100),YARN_ITEM,Yarn_week)


Excample Yarn item = CVC20/1R week 18

จับภาพ.PNG

6 Replies
Or
MVP
MVP

I wasn't able to understand what you're trying to do here.

You are comparing two different formulas. Why should they give the same result?

Additionally, you are using Sum(Distinct ...) which is almost always a bad idea since the same value might repeat multiple times.

marcus_sommer

There are various things noticeable. At first the distinct within the sum() like orsh_ hinted. Further the dimensions within the second table aren't the same like in the aggr and then it missed an outer aggregation.

- Marcus

penpayom
Contributor
Contributor
Author

I tried the same formula with the table below. But the value does not match. So try to group with aggr. What formula should I use to calculate?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Shouldn't you just use:

=sum(Fabric_QTY *(ITEM_CONTAIN/100))

for both tables?

-Rob

balabhaskarqlik

May be this:

=Aggr(Sum(Fabric_QTY * (ITEM_CONTAIN/100)),YARN_ITEM)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Bala, why Aggr()?

-Rob