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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AGGR()

Hi my name is Andrea,

I would like to understand how to solve this issue.

CategorySupplierPurchaseTot PurchasePurchase %
1A1000600016%
1B2000600034%
1C3000600050%
Tot6000100%
2D1000300033%
2E2000300067%
Tot3000

100%

If i use this formula: aggr(NODISTINCT sum(Purchase),Category) i can get the column "Tot Purchase" and "Purchase %" as in the table. But if i click on a supplier (for example supplier A) the Tot Purchase becomes 1000 and Purchase % becomes 100%.

Is there any solution for this issue?

I would like to click on a supplier and mantain the same result.

Thanks to all in advanced.

Andrea

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Awesome, I am glad you were able to figure it out .

If you got everything you were looking for, I would ask you to close this thread by marking correct and helpful responses.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

View solution in original post

13 Replies
Clever_Anjos
Support
Support

Maybe

aggr(NODISTINCT sum({<Supplier>}Purchase),Category)

sunny_talwar
MVP
MVP

Can you try these expressions

Tot Purchases

Sum(TOTAL <Category> {<Supplier>} Purchases)

Purchase %

Sum({<Supplier>} Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)

Update: I would make sure that Purchase % expression is not set to relative. In other words, uncheck relative for Purchase % expression

MK_QSL
MVP
MVP

Sunny, If we use Total Qualifier with {<Supplier>}, we would not be able to use filter in chart..

sunny_talwar
MVP
MVP

How about this:

Tot Purchases

Sum(TOTAL <Category> {<Supplier>} Purchases) * Avg(1)

Purchase %

Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)

MK_QSL
MVP
MVP

Great !

Anonymous
Not applicable
Author

Thanks to all,


If i would like to calc the Fractile of the following formula


Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)


Can i simple make this:


Fractile(

Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)

,0.25)


or i have to do introduce other things in order to calc the same result for any selected supplier?

sunny_talwar
MVP
MVP

May be like this:

Fractile(TOTAL <Category> Aggr(Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)

,0.25), Category, Supplier))


or


Fractile(TOTAL Aggr(Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases)

,0.25), Category, Supplier))

Anonymous
Not applicable
Author

I tried with both but it give to me error in the expression. I would like to ask about last piece of expression:

, Category, Supplier))

These are the arguments of which expression? Fractile? because i thought that Fractile function end with ,0.25)

sunny_talwar
MVP
MVP

Opps, My bad,

Fractile(TOTAL <Category> Aggr(Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases), Category, Supplier), 0.25)


or


Fractile(TOTAL Aggr(Sum(Purchases)/Sum(TOTAL <Category> {<Supplier>} Purchases), Category, Supplier), 0.25)