Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
madmax88
Creator II
Creator II

how highest value of Dimension A in Dimension B

Hi all

I have 2 dimensions: the first is Dimension "Problem" and the 2nd "Reaction". The Goal is to Show the highest value (Count) of Problem in the Dimension "Reaction". For example the most often Problem of customers is A

The Pie Chart "Reaction" must Show the different reactions of the customers with Problem A.

Atm I only get the highest value of the Problem by

max(aggr(count({$<

Source={'V2}>}#),Problem))

But I need the Dimension - not the value. Do you have any idea how i could works?

Thanks,

Max

15 Replies
devarasu07
Master II
Master II

Hi,

Can you try like this

FirstSortedValue(DISTINCT Problem,-aggr(count({$<Source={'V2}>}#),Problem))

madmax88
Creator II
Creator II
Author

Hi,

Thanks for ur advice, but it still doesnt' work (No value appears). Im not sure if this Expression goes to the rigth direction.

Point is that the highest value of "Problem" can Change -->depending on a different selection. For example: If I choose the product "Loan" the highest value of Problem is Service, but for product "Card" the most current Problem is "billing".

So if I choose "Loan" as Product then in the Dimension "Problem" the most current value is "Service". Now in Dimension "Reaction" there must come all reactions for the "Service" automatically.

Is it even possible or are there too many variables?

Thanks

sunny_talwar

May be because of a missing single quote?

FirstSortedValue(DISTINCT Problem, -Aggr(Count({$<Source = {'V2'}>} #), Problem))

madmax88
Creator II
Creator II
Author

No, I already found this missing Quote..

sunny_talwar

Would you be able to share a sample to see the issue?

madmax88
Creator II
Creator II
Author

Hi Sunny,

Thanks for your Patience. Below an example for you

   

ProblemValue
Creditcard20
Loan10
Other A5
Other B1
Other C

3

   

ProblemReactionValue
CreditcardAngry20
CreditcardTermination40
CreditcardProd Change10
LoanAngry5
LoanTermination10
LoanDesperately45
LoanOther2
Other AX4
Other AAngry12
Other BZ14
Other CAngry19
Other CH21

For this tables the most often Problem ist Creditcard. Now I have 2 pie Charts. The first pie Chart Shows me the Distribution of the 3 mosten current Problems (this works already). The Second Chart has the Dimension Reaction. The Goal is now that the 2nd Charts Shows (without clicking) only the reactions from Creditcard (because Creditcard is the most often Problem). So the 2nd chard would Show me Angry=20, Termination=40 and Prod Change=10

Next step would be (if possible) a 3rd Chart which is showing me the Reactions of the Problem with the 2nd larges majority - in this case Loan.

Does it help you?

sunny_talwar

May be this

2nd chart

Sum({<Problem = {"$(=FirstSortedValue(DISTINCT Problem, -Aggr(Count({$<Source = {'V2'}>} #), Problem)))"}>}Value)

3rd chart

Sum({<Problem = {"$(=FirstSortedValue(DISTINCT Problem, -Aggr(Count({$<Source = {'V2'}>} #), Problem), 2))"}>}Value)

madmax88
Creator II
Creator II
Author

It doesn't recognize the Expression after

"Sum({<Problem ="

So i tried

Sum({$<Problem= {$(=FirstSortedValue(DISTINCT Problem, -Aggr(Count({$<Source= {'V2'}>} #), Problem)))}>}#)

It doesn't recognize the Expression after Sum({$<Problem = {-->the "$" is on a wrong place.

If I take it out, the formula is ok but no value appears

Sum({$<Problem={'$(=FirstSortedValue(DISTINCT Problem, -Aggr(Count({$<Source= {'V2'}>} #), Problem)))'}>}#)

Do i missunderstand some Expression values?

sunny_talwar

It doesn't recognize? What do you mean? Have you tried clicking okay to see if it gives the right result or not?