Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

madmax88
Contributor

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

Tags (1)
15 Replies
devarasu07
Honored Contributor II

Re: how highest value of Dimension A in Dimension B

Hi,

Can you try like this

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

Highlighted
madmax88
Contributor

Re: how highest value of Dimension A in Dimension B

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

MVP
MVP

Re: how highest value of Dimension A in Dimension B

May be because of a missing single quote?

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

madmax88
Contributor

Re: how highest value of Dimension A in Dimension B

No, I already found this missing Quote..

MVP
MVP

Re: how highest value of Dimension A in Dimension B

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

madmax88
Contributor

Re: how highest value of Dimension A in Dimension B

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?

MVP
MVP

Re: how highest value of Dimension A in Dimension B

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
Contributor

Re: how highest value of Dimension A in Dimension B

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?

MVP
MVP

Re: how highest value of Dimension A in Dimension B

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