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: 
amber2000
Creator
Creator

Conditional set analysis with Aggr function

Hi everyone,

I would like to rewrite this statement to add a condition (it works fine):

=sum({$<[PC_Wrapping_Errors] = {"1"}>}Aggr(max([PC_Colli_Checked]),[PC_Ass]))

It's only working for those records who have value 1 in PC_Wrapping_Errors.

I would like to add the following (this is my pseudocode:

Sum (if (PC_Wrapping_Errors] = {"1"}

            then Aggr(max([PC_Colli_Checked]),[PC_Ass]))

                 Else Aggr(max([PC_Colli_Checked]),[PC_Pallet])))

Does anybody know how I can do this please?

I've tried this but it doesn't work:

//=if(PC_Wrapping_Errors > '1' ,Sum(Aggr(max([PC_Colli_Checked]),[PC_Ass])),

// if(PC_Wrapping_Errors < '0', Sum(Aggr(max([PC_Colli_Checked]),[PC_Pallet])))

kind regards,

Monique

1 Solution

Accepted Solutions
Anonymous
Not applicable

may be this

//=if(PC_Wrapping_Errors = '1' ,Sum(Aggr(max([PC_Colli_Checked]),[PC_Ass])), Sum(Aggr(max([PC_Colli_Checked]),[PC_Pallet])))



View solution in original post

2 Replies
Anonymous
Not applicable

may be this

//=if(PC_Wrapping_Errors = '1' ,Sum(Aggr(max([PC_Colli_Checked]),[PC_Ass])), Sum(Aggr(max([PC_Colli_Checked]),[PC_Pallet])))



amber2000
Creator
Creator
Author

Hi Allu,

It didn't work but after changing >1  into  >= 1 it worked fine.

Than you so much.

Kind regards,

Monique