Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
thierrytt1102
Partner - Creator II
Partner - Creator II

aggr function help

Hello All,

I made a fomula which is good for an individual item :

sum(aggr(sum({<TypeDocument={SO,CO}, GL_Class_SO={'FNE'}>} SalesQuantity), ItemNo) * aggr(sum(DirectLaborItem), ItemNo))

(DirectLaborItem is the direct labor for an individual item)

When I unselect the item, I have got a result for all the item which is OK as well.

Now, I'd like to have the result of all my items even if I select one.

I made this:

sum(aggr(sum({1<Period=P(Period), TypeDocument={SO,CO},GL_Class_SO={'FNE'}>} TOTAL SalesQuantity), ItemNo) *aggr(sum(DirectLaborItem), ItemNo))

but the result is false.

Could you help me?

Thank a lot in advance

T T

1 Solution

Accepted Solutions
swuehl
MVP
MVP

It is not trivial to answer your question, not knowing your data model etc. If possible, upload a small sample file, this makes it easier for us to help you.

If you want to ignore selections in field ItemNo (that's what I understood), I would start with ignoring this field's selection in a set expression in all of your aggregation functions:

= sum( {<ItemNo= >}

               aggr(sum({<ItemNo=, TypeDocument={SO,CO}, GL_Class_SO={'FNE'}>} SalesQuantity), ItemNo) *                aggr(sum({<ItemNo=>} DirectLaborItem), ItemNo)

)

[And I think this should be equivalent:

= sum( {<ItemNo= >}

               aggr(

                         sum({<ItemNo=, TypeDocument={SO,CO}, GL_Class_SO={'FNE'}>} SalesQuantity)*                          sum({<ItemNo= >} DirectLaborItem)

                    , ItemNo)

)

]

View solution in original post

2 Replies
swuehl
MVP
MVP

It is not trivial to answer your question, not knowing your data model etc. If possible, upload a small sample file, this makes it easier for us to help you.

If you want to ignore selections in field ItemNo (that's what I understood), I would start with ignoring this field's selection in a set expression in all of your aggregation functions:

= sum( {<ItemNo= >}

               aggr(sum({<ItemNo=, TypeDocument={SO,CO}, GL_Class_SO={'FNE'}>} SalesQuantity), ItemNo) *                aggr(sum({<ItemNo=>} DirectLaborItem), ItemNo)

)

[And I think this should be equivalent:

= sum( {<ItemNo= >}

               aggr(

                         sum({<ItemNo=, TypeDocument={SO,CO}, GL_Class_SO={'FNE'}>} SalesQuantity)*                          sum({<ItemNo= >} DirectLaborItem)

                    , ItemNo)

)

]

thierrytt1102
Partner - Creator II
Partner - Creator II
Author

Thank you swuehl,

It solved my issue. I didn't tought about it.