Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Compare between values within a row (Max/Min)

Hi,

Is there a way to compare between certain fields values within a row (On Script)?

I have 5 fields, and want to insert the maximum between them to a new column.

Max function not relevant for this type of case.

Is there a way to do that?

Thanks in advance

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: Compare between values within a row (Max/Min)

The function RangeMax and RangeMin should be helpful. They can take a variable number of parameters and get the Min/Max and they work both in script and in charts:

http://help.qlik.com/en-US/sense/June2017/Subsystems/Hub/Content/ChartFunctions/RangeFunctions/range...

http://help.qlik.com/en-US/sense/June2017/Subsystems/Hub/Content/ChartFunctions/RangeFunctions/range...

Should be like this in your case:

RangeMax( Field1 , Field2 , Field3 , Field4 , Field5 )

View solution in original post

2 Replies
Highlighted
MVP
MVP

Re: Compare between values within a row (Max/Min)

The function RangeMax and RangeMin should be helpful. They can take a variable number of parameters and get the Min/Max and they work both in script and in charts:

http://help.qlik.com/en-US/sense/June2017/Subsystems/Hub/Content/ChartFunctions/RangeFunctions/range...

http://help.qlik.com/en-US/sense/June2017/Subsystems/Hub/Content/ChartFunctions/RangeFunctions/range...

Should be like this in your case:

RangeMax( Field1 , Field2 , Field3 , Field4 , Field5 )

View solution in original post

Highlighted
Contributor II
Contributor II

Re: Compare between values within a row (Max/Min)

if(F1>F2 and F1>F3 and F1>F4 and F1>F5,  F1,

if(F2>F3 and F2>F4 and F2>F5, F2,

if(F3>F4 and F3>F5, F3,

if(F4>F5, F4, F5))))