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

Pick(Match()) or may be another function

Hey Qlikers,

There might be a very easy solution for this, but I am kind of confused on how I can achieve this. I have a formula like this:

=Pick(Match(23, 23, 34, 23, 45), 'R', 'T', 'P', 'K') and when I put this in a text box, I get the output to be R (which makes sense because its matching the first instance of the number to match with and giving me the output R.

What I want is to be able to somehow get the output R, P.

To give some details about what exactly I am doing:

=Pick(Match(MaxfromMultipleFieldsusingRangeMax, MaxField1, MaxField2, MaxField3.....), 'Field1', 'Field2', 'Field3'....)

All the responses are greatly appreciated.

Best,

Sunny

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

How about a variable function that you can call for each field. Something like the attached.

View solution in original post

14 Replies
sunny_talwar
Author

Just a thought: may be I can use Concat function with set analysis

Any ideas?

Best,

Sunny

anbu1984
Master III
Master III

=Pick(Match(23, 23, 34, 45), 'R, P', 'T', 'K')

sunny_talwar
Author

Thanks for your response anbu cheliyan

But this was just an hard coded example, the actual values may vary. I am using functions instead of numbers here so I won't know what comes together. The function looks something like this:

=Pick(Match(MaxfromMultipleFieldsusingRangeMax, MaxField1, MaxField2, MaxField3.....), 'Field1', 'Field2', 'Field3'....)

Best,

Sunny

anbu1984
Master III
Master III

If you don't have many fields, then use if like

vMaxValue=MaxfromMultipleFieldsusingRangeMax

Replace(Trim(If(vMaxValue = MaxField1Expr,'Field1') & ' ' & If(vMaxValue = MaxField2Expr,'Field2') & ' ' & If(vMaxValue = MaxField3Expr,'Field3') ), ' ', ',')

sunny_talwar
Author

I have 14 fields right now, but this is kind of a template app and it could increase up to 25 I think for other versions. I do have this as an alternative, but I thought there must be an easier way to do it. (may be using concat and set analysis?)

But once again thanks for your response.

Best,

Sunny

Not applicable

You could do this with conat and set analysis yea, you would need a data island of your position value and result though I think, for that to work.

basic example attached

hope that helps

Joe

stigchel
Partner - Master
Partner - Master

How about a variable function that you can call for each field. Something like the attached.

sunny_talwar
Author

This looks like it could work, I just need to test it out for the application I am working on.

Thanks Piet Hein van der Stigchel

Best,

Sunny

sunny_talwar
Author

Piet Hein van der Stigchel‌ Can I do something like this in the variable you created?

vIsMax

If(Max({<Year = {2015}>}[$1]) - Max({<Year = {2014}>}[$1]) = RangeMax(Max({<Year = {2015}>}Field1) - Max({<Year = {2014}>}Field1), Max({<Year = {2015}>}Field2) - Max({<Year = {2014}>}Field2), Max({<Year = {2015}>}Field3) - Max({<Year = {2014}>}Field3)),Right('$1', 2),'')



and then use the variable like this

$(vIsMax(Field1))&$(vIsMax(Field2))&$(vIsMax(Field3))

Best,

Sunny