Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikosapiens
New Contributor

Set Analysis? Find Formula Value for Dimension Value

Dear all,

I have the following graph with test data:

Now I want to show a text box like this:

This one was created using the following formula:

'The Dim1 value with the highest value in sum(Expression1) is: ' max(aggr(sum(Expression1), Dim1)) // here I want to see "C", not the formula value.

However, I do not want to show the formula value of 134707, but the dimension value "C". How can I do this? With set analysis?

Please find attached the QVW. Thank you very much in advance.

QS

1 Solution

Accepted Solutions

Re: Set Analysis? Find Formula Value for Dimension Value

Try this

='The Dim1 value with the highest value in sum(Expression1) is: ' & FirstSortedValue(Dim1, -aggr(sum(Expression1), Dim1)) // here I want to see "C", not the formula value.

5 Replies

Re: Set Analysis? Find Formula Value for Dimension Value

Try this

='The Dim1 value with the highest value in sum(Expression1) is: ' & FirstSortedValue(Dim1, -aggr(sum(Expression1), Dim1)) // here I want to see "C", not the formula value.

qlikosapiens
New Contributor

Re: Set Analysis? Find Formula Value for Dimension Value

Thank you very much, that did the job!

- QS

kakani87
Contributor III

Re: Set Analysis? Find Formula Value for Dimension Value

Hi Sunny .... what  exactly -Aggr() dose here could you explain this expression

fawazeez
Contributor

Re: Set Analysis? Find Formula Value for Dimension Value

aggr is creating a virtual table with 2 columns dim1 and its sum. FirstSortedValue will get the max(beacuse of negative sign) in DIM1 from that table

kakani87
Contributor III

Re: Set Analysis? Find Formula Value for Dimension Value

Thank you Fawaz for the clarification.

Community Browser