Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Text Box to Display Top Operation Name

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.

4 Replies
chauhans85
Esteemed Contributor

Text Box to Display Top Operation Name

in text box

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

Not applicable

Text Box to Display Top Operation Name

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

Text Box to Display Top Operation Name

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

Text Box to Display Top Operation Name

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.

Community Browser