Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max of a set of values in script

Hi all,

In the script, I need a column which displays the max of a set of values, for example

Location     Value      Max

London          1              6

London          5               6

London          6               6

New York      3               3

New York       2               3

Paris             5               5

Is there a way to create the third column? I need to do this in the script as there's some tricky aggr in the front end.

Thank you very much!

3 Replies
tresesco
MVP
MVP

Load * From <>;

Join

Load

          Location,

          Max(Value) as Max

From <> Group By Location;

karthikbi
Partner - Contributor
Partner - Contributor

Data:

LOAD * INLINE [

    Location, Value, Max

    London, 1, 6

    London, 5, 6

    London, 6, 6

    New York, 3, 3

    New York, 2, 3

    Paris, 5, 5

];

LOAD Location,max(Value) as New_Max resident Data Group by Location ;

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Data:

LOAD

*,

If(Previous(Location) <> Location,  Value, Peek('Max')) AS Max;

SELECT

*

FROM Table

ORDER BY Location, Value Desc;

Hope this helps you.

Regards,

Jagan.