Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
thierrytt
Partner
Partner

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)

)

]

View solution in original post

thierrytt
Partner
Partner
Author

Thank you swuehl,

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