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

AGGR Function Problems with 2 expressions or 2 dimensions

Hello,

i try to solve following problem with the following dataset. the data produces duplicates with an counter. That is the example dataset:

OrderDateCounterValue
A01.01.2013110
A02.01.2013210
A03.01.2013310
A04.01.2013410
B01.01.2013115
B02.01.2013215
B03.01.2013315
C01.01.2013120
C02.01.2013220

To get the value of the orders i use following formula, which is correct:

sum ( aggr ( max (Value),Order)) = 45

No there is the problem. I want to build a graph (table or pie chart) which shows the MAX Counter and the Value of it. The Formula

sum ( aggr ( max (Value),Order, Counter )) doesn´t show the correct results. It should be like:

Counter Value

4 = 10

3 = 15

2 = 20

How can i use the AGGR Formula with 2 expressions (max (Value)) and (max (Counter)).

PLEASE is there anybody with an idea? 

Kind regards

jezze


2 Replies
Gysbert_Wassenaar

Use Order as dimension and as expressions max(Counter) and max(Value). You don't need the aggr function since you're using only one aggregation function. Because Order is used as dimension the expressions will be aggregated for A, B and C.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

thank you for your fast reply and sorry, i didn´t exactly understand.

In the example data set, there can be a lot of orders with counter 4. Therefore i thought to use sum(aggr... ) formula. e.g.:

Counter |  Value

4          | 100     

(100 -> 10(A) + 30 (F) + 50(G) + 10(Z))

how can is use expressions max(counter) and max(value) as you described? Follwing formula is not working:

sum ( aggr ( max (Value) and max(Counter),Order ))