Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the max value in an array ?

Hi all,

I'm newbie in Qlik and I'm trying to understand some basic concepts of Qlikview.

I have a table with record number and a random number assigned to it. So it is like;

1 5

2 2

3 7

4 9 ... so on.

I want to get max value of record number on the left column so that I can use it in another calculation on the script. I'm using something like ;

let maxtry = max([trial time]);

But this expression returns null on the script. All helps appreciated .

PS : I've tried to use this expression on a text box and I can show the maximum value of this array in this box. I still don't understand why is it working on text expression side and not working on script side.

1 Solution

Accepted Solutions
sunny_talwar

You need to add another load in between to find the max value

Table:

LOAD SNo,

          TrialTime

FROM Source

MaxTrialTime:

LOAD Max(TrialTime) as MaxTrialTime

Resident Table;

LET maxtry = Peek('MaxTrialTime');

DROP Table MaxTrialTime;

View solution in original post

1 Reply
sunny_talwar

You need to add another load in between to find the max value

Table:

LOAD SNo,

          TrialTime

FROM Source

MaxTrialTime:

LOAD Max(TrialTime) as MaxTrialTime

Resident Table;

LET maxtry = Peek('MaxTrialTime');

DROP Table MaxTrialTime;