Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

qlikrajan
Contributor III

retrieve name of field corresponding to range max value

Hi all,

Wondering if there is any way to retrieve field name associated with range max value. I don't want to use crosstable and then firstsorted value.

 

ABCField
101523C
10162B

Thanks

1 Solution

Accepted Solutions

Re: retrieve name of field corresponding to range max value

May be this

Pick(Match(RangeMax(A, B, C), A, B, C), 'A', 'B', 'C') as Field,

View solution in original post

17 Replies

Re: retrieve name of field corresponding to range max value

May be this

Pick(Match(RangeMax(A, B, C), A, B, C), 'A', 'B', 'C') as Field,

View solution in original post

Re: retrieve name of field corresponding to range max value

Here is a sample from your data

Capture.PNG

qlikrajan
Contributor III

Re: retrieve name of field corresponding to range max value

This is a good solution. Sunny, there are more than 150 field that's why i didn't want to do crosstable. Here also i will have to write all fields name. Any alternate direct function in your knowledge?

qlikrajan
Contributor III

Re: retrieve name of field corresponding to range max value

i mean similar to firstsorted value in array

Re: retrieve name of field corresponding to range max value

Not sure bro. I have never seen a function pull field name using a value within the field. I mean there are FieldValue() functions, but not sure how they can be used here. I will keep testing and let you know

qlikrajan
Contributor III

Re: retrieve name of field corresponding to range max value

I tried all fieldsuffix function, not worked...but thanks.

Re: retrieve name of field corresponding to range max value

I will keep digging. May be swuehl‌ can offer his expert advice also

MVP & Luminary
MVP & Luminary

Re: retrieve name of field corresponding to range max value

You don't necessarily have to list all fieldnames in a cross table. You can use "*". What does your data look like?

MVP & Luminary
MVP & Luminary

Re: retrieve name of field corresponding to range max value

You can generate the pick(match()) dynamically in a chart as:

=Pick(Match(RangeMax(

$(=concat([$Field],','))

),

$(=concat([$Field],','))

),

$(=

chr(39)

& concat([$Field], chr(39) & ',' & chr(39))

& chr(39)

)

)

You can limit the field list to a particular table by adding a bit of <$Table={xyz}> set analysis into the concat(). Or exclude certain fields.

You can do something similar in the script. but yu would have to build up the field list in a variable loop using the fieldname() function. A bit more work.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com