Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text Box to Display Top Operation Name

Hi All,

I have a bar chart that uses an aggregation function to display a value over the dimension "operation". I then use an expression in the sort by tab to order the bar chat in ascending order. This shows me the operation with the highest value


I want a text box that will give me the name of this operation. Thats all

My expression in my chart as I believe you may need this is sum(abc*123)


Thanks,
Byron

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

this is taken from the Help:

firstsortedvalue( [{set_expression}] [ distinct ] [ total [<fld {, fld}>] ] expression [, sort_weight [, n]])

returns the first value of expression sorted by corresponding sort-weight when expression is iterated over the chart dimension(s). Sort-weight should return a numeric value where the lowest value will render the corresponding value of expression to be sorted first. By preceding the sort-value expression with a minus sign, the function will return the last value instead. If more than one value of expression share the same lowest sort-order, the function will return null. By stating an n larger than 1, you will get the nth value in order.

So u have to change the sign in the sort-value expression.

C u,

Stefano.

View solution in original post

4 Replies
SunilChauhan
Champion
Champion

in text box

max(aggr(sum(abc*123),fieldName))

Sunil Chauhan
Not applicable
Author

Hi Byron,

u can create a new straith table sorted and in "Presentation Tab" set 1 in "Max Number (1 - 100)"

or if u want a text box u can use something like "firstsortedvalue Function".

I hope this help you.

C u,

Stefano.

Not applicable
Author

Thanks All

Sunil that function returns a value, I want the name of the dimension value. Ste.san, thanks for that, the firstsortedvalue returns the name of the dimension. Unfortunately this is the smallest value, is there an equivalent to this that returns the value for the highest value???

Thanks,
Byron

Not applicable
Author

Hi,

this is taken from the Help:

firstsortedvalue( [{set_expression}] [ distinct ] [ total [<fld {, fld}>] ] expression [, sort_weight [, n]])

returns the first value of expression sorted by corresponding sort-weight when expression is iterated over the chart dimension(s). Sort-weight should return a numeric value where the lowest value will render the corresponding value of expression to be sorted first. By preceding the sort-value expression with a minus sign, the function will return the last value instead. If more than one value of expression share the same lowest sort-order, the function will return null. By stating an n larger than 1, you will get the nth value in order.

So u have to change the sign in the sort-value expression.

C u,

Stefano.