Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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

Tags (1)
1 Solution

Accepted Solutions
Partner
Partner

Re: Pick(Match()) or may be another function

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

View solution in original post

14 Replies

Re: Pick(Match()) or may be another function

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

Any ideas?

Best,

Sunny

anbu1984
Honored Contributor III

Re: Pick(Match()) or may be another function

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

Re: Pick(Match()) or may be another function

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

Highlighted
anbu1984
Honored Contributor III

Re: Pick(Match()) or may be another function

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') ), ' ', ',')

Re: Pick(Match()) or may be another function

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

Re: Pick(Match()) or may be another function

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

Partner
Partner

Re: Pick(Match()) or may be another function

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

View solution in original post

Re: Pick(Match()) or may be another function

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

Re: Pick(Match()) or may be another function

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