# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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?

QS

1 Solution

Accepted Solutions
MVP

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

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

New Contributor

## Re: Set Analysis? Find Formula Value for Dimension Value

Thank you very much, that did the job!

- QS

Contributor III

## Re: Set Analysis? Find Formula Value for Dimension Value

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

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

Contributor III

## Re: Set Analysis? Find Formula Value for Dimension Value

Thank you Fawaz for the clarification.