Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
AT2022
Contributor
Contributor

Using Aggr function

Hi Qlik Developpers,

My question is regarding with "AGRR" function.

I have a calculatation

aggr(sum(STMENGE1070),KURZTEXT)/sum({<KURZTEXT=>}STMENGE1000)*1000000,

Field STMENGE1070 is including value according to KURTTEXT but STMENGE1000 is not.

The expression is okey but it has not any graphic when the X axis is KURZTEXT althoug value is valid. 

I added some photo from my work.

Thank you for your support.

 

 

Labels (4)
6 Replies
Or
MVP
MVP

I'm confused as to why the aggr() function is being used here in the first place?

 

 

AT2022
Contributor
Contributor
Author

My aim that creating a graphic have including KURZTEXT(cause definition of not okey product ) on X axis and my calculation on Y axis.

I can not create any group for KURZTEXT on denominator of my Calculation because there is no any connection between  STMENGE1000 and KURZTEXT. (STMENGE1000 is indicated that they are product comes from supplier)

I met not define value on graffic If not using AGGR function on share side, because there is no any connection between  STMENGE1000 and KURZTEXT.

please let us know if there any solution in here.

I am new on Qlik Dev side.

Or
MVP
MVP

If there is no connection between the two fields, I don't see how aggr() will solve that for you... you'll just get one large bar for the null dimension value, which perfectly matches your screen capture. aggr() doesn't generate a connection where no connection exists.

AT2022
Contributor
Contributor
Author

yes you are right aggr() doesn't generate a connection. thats why I did not use any AGGR on denominator of my Calculation. I used only share side.

for the better explanation =>        AGGR(Share side)/denominator side

How can I solve this problem please let us know how I can do.

marcus_sommer

You need to ensure that all needed associations between the data are made within the data-model. If it's not possible to do it there you won't be able to bypass it within the UI.

Beside this I suggest to group/categorize everything possible within the script and also considering to resolve the crosstable-structures of the multiple sales- and amount-fields per The Crosstable Load - Qlik Community - 1468083.

Or
MVP
MVP

This isn't something that can be fixed with a formula. Your data model needs to allow the data to be connected if you want to use these in the same expression, or you need to explicitly state a connection using set analysis if one exists, typically using p(). Once that happens, you wouldn't need aggr(), just use a regular sum().