Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
julioarriaga
Creator II
Creator II

Why can't I assign the returned value of a max function to a variable?

Hi everyone,

The following script doesn't assign the value to the variable, and I was wondering why:

LOAD * INLINE [A

23

74

342

2];

LET vMax = MAX(A);

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Because the Max() function can only be used in a LOAD statement:

https://help.qlik.com/en-US/sense/April2018/Subsystems/Hub/Content/Scripting/AggregationFunctions/ag...

Data:

LOAD * INLINE [A 

23 

74 

342 

2]; 


Max:

LOAD Max(A) as MaxA

Resident Data;

 

LET vMax = Peek('MaxA',0,'Max')

View solution in original post

1 Reply
swuehl
MVP
MVP

Because the Max() function can only be used in a LOAD statement:

https://help.qlik.com/en-US/sense/April2018/Subsystems/Hub/Content/Scripting/AggregationFunctions/ag...

Data:

LOAD * INLINE [A 

23 

74 

342 

2]; 


Max:

LOAD Max(A) as MaxA

Resident Data;

 

LET vMax = Peek('MaxA',0,'Max')