Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator 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
Highlighted
Creator II
Creator II

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.

View solution in original post

17 Replies
Highlighted

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

Highlighted
Partner
Partner

or aggr functiin. pls add am exemple.

Highlighted
Master II
Master II

Please share your current expression.

Highlighted
Creator II
Creator II

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

Highlighted

Can you try this:

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

Highlighted
Creator II
Creator II

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.

Highlighted
MVP
MVP

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)

Highlighted
MVP
MVP

or

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

Highlighted

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