Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
THWTEMJIRAS
Contributor II
Contributor II

Error Calculation after subtracting with another set of analysis of Aggr function

I'm can't solve this issue for a week now. If anyone could help, I would greatly appreciate it. Thank you very much.

I have expected that the highlight yellow column "[Required Delivery Date - Today - Num Aggr]" as screenshot below, it should show some result of subtraction between the next two columns on the right column (examples)

"1)[ Num Required Delivery Date-Today]" - "2) [Aggr (ATA-ATD)]", but only some line that have a result (-1111-(+2) = 1109)

Here is my current formula to combine those two columns toget,

=

num([Required Delivery Date])-num(today())

-

aggr(sum({<[PO Number]=,[Material_Code]=,[PO Item Status]=>}(num(ATA)-num(ATD))),Material_Code)

/

aggr(count({<[PO Number]=,[Material_Code]=,[PO Item Status]=>}(num(ATA)-num(ATD))),Material_Code)

 

THWTEMJIRAS_3-1690781691172.png

 

Labels (5)
1 Solution

Accepted Solutions
marcus_sommer

You may try it by adjusting the aggr() approach like: aggr(NODISTINCT ...) or with sum(aggr(...))

Further you could simplify the expression by removing the various num() which are having no effect and also trying to combine the sum() and count() within a single aggr() like:

sum(aggr(sum() / count(), Dim))

View solution in original post

2 Replies
marcus_sommer

You may try it by adjusting the aggr() approach like: aggr(NODISTINCT ...) or with sum(aggr(...))

Further you could simplify the expression by removing the various num() which are having no effect and also trying to combine the sum() and count() within a single aggr() like:

sum(aggr(sum() / count(), Dim))

THWTEMJIRAS
Contributor II
Contributor II
Author

Thank you very much for your suggestion. It's work 😀