Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sivarajs
Specialist II
Specialist II

Rangemax in script

Hi,

I am trying  to use rangemax,Chart level its working but in script its not working

Any idea...

Sivaraj S

14 Replies
sivarajs
Specialist II
Specialist II
Author

LOAD

     *,

RANGEMAX(a,b,c,d,e) as TEXT ; // each field has single value

resident tmp;

TEXT getting all the values

jagan
Luminary Alumni
Luminary Alumni

Hi,

If a, b, c, d and e are fields, then RANGEMAX(a,b,c,d,e) will return the maximum value among those values for each record.

RANGEMAX(a,b,c,d,e) as TEXT

I didn't understand about this "TEXT getting all the values", if you do not want a, b, c, d, e fields then just use following script

LOAD

     RANGEMAX(a,b,c,d,e) as TEXT

resident tmp;

Regards,

Jagan.

swuehl
MVP
MVP

So a,b,c,d and e are fields in your tmp table, right?

What are the values of all these fields? You mentioned that you got

1

2

3

4

returned for the RANGEMAX(a,b,c,d,e) function. So these are the first four values of your TEXT field?

Could you post the first four complete lines for your table, including TEXT and a,b,c,d,e?

Are all your values numericals or are you coping with text values? You might want to consider using rangemaxstring(a,b,c,d,e) as TEXT

then.

It would be best if you could post a small sample app that demonstrates what you are trying to achieve and your issue. If this is not possible, please provide a sufficient snippet of your script and some sample data (input to your code snippet / output table).

sivarajs
Specialist II
Specialist II
Author

Hi sweuhl,

I guess rangemax is not working because of data stored in qvd is below format

 

ABCDEF
0.06640670.22879810.34169960.33348350.06075390.3978605
0
0.0839515
0
0.2428004
0
0.2099772
0
0.1059254
0
0.0761975
0
0.1439361


i am using for loop to get values based on customer

for 1st loop i giving correct value if it goes to 2nd further its storing like the table above

Can you suggest me on this

swuehl
MVP
MVP

You are using for loop to get values based on customer?

Are the above table fields the only fields in your table? I guess you need to have at least one more field, your dimension (maybe customer)?

If so, you could try using a group by load

Result:

LOAD Dimension,

Rangemax(sum(A),sum(B),sum(C),sum(D),sum(E),sum(F)) as RangeMax

resident YourTable group by Dimension;