Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
meetmrudul
Contributor II

Top Nth value in text object

Hi All,

We have a chart, where we have kept the dimension limit as 7.

We want to showcase the 1st to 7th value in three different text objects, from the chart.

I have used the FirstSortedValue() function, and it works fine for 1st to 4th.

For 5th, 6th and 7th value, it giving me 'Null' values in text object, as all of them have same metric value.

As per one of the post, I have tried to use 'DISTINCT' keyword, still values not matching with chart.

Could you please assist me on same.

Thanks & Regards,

MK

1 Solution

Accepted Solutions
meetmrudul
Contributor II

Re: Top Nth value in text object

Thanks to all, for your reply.

finally I found a solution using below link:

Displaying the Top Salesperson in a Textbox

Just a change in the expression of Rank, we will have to add the Offset value as 4, to get the value in text object.

17 Replies

Re: Top Nth value in text object

Can you share the expression you are using in the chart and in the text box object?

Partner
Partner

Re: Top Nth value in text object

or aggr functiin. pls add am exemple.

trdandamudi
Honored Contributor

Re: Top Nth value in text object

Please share your current expression.

meetmrudul
Contributor II

Re: Top Nth value in text object

in the chart -

count({<Dim2={'A'}>}Dim1) /

count(TOTAL {<Dim2={'A'}, Dim3=>}Dim1)

This is the because, the chart based on Dim3 and I want to have percentage w.r.t others.

In Text Object-

FirstSortedValue(DISTINCT Dim3,

aggr(count({<Dim2={'A'}>}Dim1) /

count(TOTAL {<Dim2={'A'}, Dim3=>}Dim1) ,Dim3),5)


I have tried this, sorry, as i have not written the aggregated dimension name

Re: Top Nth value in text object

Can you try this:

FirstSortedValue({<Dim2={'A'}>} DISTINCT Dim3, Aggr(Count({<Dim2={'A'}>}Dim1)/Count(TOTAL {<Dim2={'A'}, Dim3=>}Dim1), AggrgatingDimensionNameHere) ,5)

meetmrudul
Contributor II

Re: Top Nth value in text object

I tried that, but no luck...

I tried to get the rank in chart, and the rank is 4-7 for 4th to 7th value.

When we consider Dimension limit, by default, 7 values coming.

Need inputs for 5th, 6th and 7th.

Re: Top Nth value in text object

try this

or define your actual Dimension in Aggr fucntion

FirstSortedValue(DISTINCT Dim3,

aggr(count({<Dim2={'A'}>}Dim1) /

count(TOTAL {<Dim2={'A'}, Dim3=>}Dim1),Dim3) ,5)

Re: Top Nth value in text object

or

Please provide some of the sample data with expected output so that it will be easy to provide the solution

Re: Top Nth value in text object

Did you replace this -> AggrgatingDimensionNameHere with the chart dimension/s?