Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
yanivbm88
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
petter
Partner - Champion III
Partner - Champion III

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
petter
Partner - Champion III
Partner - Champion III

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 )

vkhassanov
Contributor II
Contributor II

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