# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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
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))

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

## 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))

Contributor

## Re: how highest value of Dimension A in Dimension B

No, I already found this missing Quote..

MVP

## Re: how highest value of Dimension A in Dimension B

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

Contributor

## Re: how highest value of Dimension A in Dimension B

Hi Sunny,

Thanks for your Patience. Below an example for you

 Problem Value Creditcard 20 Loan 10 Other A 5 Other B 1 Other C 3

 Problem Reaction Value Creditcard Angry 20 Creditcard Termination 40 Creditcard Prod Change 10 Loan Angry 5 Loan Termination 10 Loan Desperately 45 Loan Other 2 Other A X 4 Other A Angry 12 Other B Z 14 Other C Angry 19 Other C H 21

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.

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)

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

## 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?