Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
daniel_bernal_y
New Contributor

Value & Max(Aggr(Value))

Hi there,

I want to obtain something like this: "White colour: 85%",

where White colour appears 85% times from total in the table.

I'm using Max(Aggr()) to obtain 85% value into a TEXT OBJECT, but... How can I get the value "White colour" from the table?

Theres only six colours in the table. White colour has more appearances.

Thanks in advance!

1 Solution

Accepted Solutions
zoltann14
New Contributor II

Re: Value & Max(Aggr(Value))

Hi,

You can use the FirstSortedValue() function, for example something like this:

=FirstSortedValue(P2_2,-aggr(Count(P2_2),P2_2)) &' : '&

NUM(Max(aggr(Count(P2_2),P2_2))/Count(Total P2_2),'#0,00%')

5 Replies
neelamsaroha157
Valued Contributor II

Re: Value & Max(Aggr(Value))

Can you share a sample file.

daniel_bernal_y
New Contributor

Re: Value & Max(Aggr(Value))

Sure I can.

Please replace "White colour" by "Todos los días" (All days), and the biggest % is equal to sum "Satisfecho" and "Muy satisfecho" values from total.

So, the only line that I want get is: "Todos los días: 85%"

Obs.: 85% is not the true value.

Thanks!

neelamsaroha157
Valued Contributor II

Re: Value & Max(Aggr(Value))

You can achieve the same results using a table. Check out the attachment.

daniel_bernal_y
New Contributor

Re: Value & Max(Aggr(Value))

I know that I can using a table, but is not the format required. The format required is a single line with 2 records separate by ":", like this: "White colour: 85%".

I'm using a Text object, and I can't get "White colour" text, just 85% using Max(Aggr()).

I don't know if I can explain myself or is very difficult to develop.

Note: I can't open you qvw file because licence issue

Thanks again.

zoltann14
New Contributor II

Re: Value & Max(Aggr(Value))

Hi,

You can use the FirstSortedValue() function, for example something like this:

=FirstSortedValue(P2_2,-aggr(Count(P2_2),P2_2)) &' : '&

NUM(Max(aggr(Count(P2_2),P2_2))/Count(Total P2_2),'#0,00%')