Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Aggr and Sum in Table

Hello,

I have the following expression:

sum(Aggr(

(SUM({<format= > }weight) / SUM(TOTAL{<format= > } weight))

*

(SUM( {<orderdate= {">=$(=max(obj_date_prod))"}, format=, flag_object={'1'}> } object_value) /100)

,Type,orderdate,format))

That gives me the following and it's OK, when I have selected Type = Product 1:

TypeOrderDateFormatExpression
3,57%
Product 128/5/2018Stuff0,12%
Product 128/5/2018Mix3,45%

But if I clear my selections for Type, then I see it like this:

TypeOrderDateFormatExpression
17,63%
Product 128/5/2018Stuff4,51%
Product 128/5/2018Mix3,54%
Product 228/5/2018Other2,10%
Product 328/5/2018Other 21,50%
Product 428/5/2018Random3,80%
Product 528/5/2018Min2,18%

Is there any way to keep the same value like in table 1 for all my Types?

Thank you!!!

1 Solution

Accepted Solutions
PrashantSangle

might be you need to group your TOTAL type wise

try below

sum(Aggr(

(SUM({<format= > }weight) / SUM(TOTAL<Type> {<format= > } weight))

*

(SUM( {<orderdate= {">=$(=max(obj_date_prod))"}, format=, flag_object={'1'}> } object_value) /100)

,Type,orderdate,format))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
sunny_talwar

Would you be able to share a sample?

PrashantSangle

might be you need to group your TOTAL type wise

try below

sum(Aggr(

(SUM({<format= > }weight) / SUM(TOTAL<Type> {<format= > } weight))

*

(SUM( {<orderdate= {">=$(=max(obj_date_prod))"}, format=, flag_object={'1'}> } object_value) /100)

,Type,orderdate,format))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂