Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using expression as a field

Dear all readers

I am searching for an answer to a tricky situation where I am creating a dynamic chart with several different pieces and this requires "rank". What I would like to do is to find a way to make rank a field or find a way to use it as a variable so I could use set analysis to show the value for a specific "rank" .

Here is my expression:

=if(MaxString({< Month =,IndicatorName={Admissions}>} Numerator)='n/a','n/a',

  num(

  if(MaxString({< Month =,IndicatorName={Admissions}>} NumDen)='Num',

  Aggr(Rank(sum({1< Month =,IndicatorName={Admissions}>} Numerator),1,1),Person)

  ,

  Aggr(Rank(sum({1< Month =,IndicatorName={Admissions}>} Numerator)/sum({1< Month =,IndicatorName={Admissions}>} Denominator),1,1),Person)

  )

  ,MaxString({< Month =,IndicatorName={Admissions}>} Format))

  )

What I would like to do is get a value from this so if I got the rank "3" for example then the "admissions" for the 3rd highest "person" would be the value that I get.

But this needs to be dynamic so I can choose which rank to get the value from.

If anyone can, please help and it will be very greatly appreciated.

7 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

You could try it with listbox-expressions like in this example: Load script full variable.

- Marcus

Not applicable
Author

Hello Marcus

First of all thank you for the reply but I am trying to avoid list boxes.

This is as I do not want this to be a selection as the way the chart will work is it will have the top 10 and since the "person" at the top might not always be there I want to be able change based on the "rank"

If you can think of any other solutions or threads I could follow that would also help.

sunny_talwar

Would it be possible for you to share a sample?

Not applicable
Author

Hello Sunny

I am afraid I cannot show you any samples as this a specific chart type that I am experimenting with at the moment and the application uses multiple binaries so it wouldn't be practical showing anything as you would never have the whole application and it's contents

marcus_sommer
MVP & Luminary
MVP & Luminary

Then have a look here: Top n / Bottom n

- Marcus

Not applicable
Author

Hello Marcus

Sorry I was not specific enough I want to have the top 10 but as separate charts that is why I want to make this a field, this is purely so I can use set analysis to find the rank and give me the value as I have tried multiple ways to try to get the rank expression as it is into set analysis but it has not worked.

I did also try to use an if function but it did not co-operate well with the expression I have used.

marcus_sommer
MVP & Luminary
MVP & Luminary

I think you will need a different approach than an expression or a calculated dimension won't be never a field and won't behave like a field.

- Marcus