Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

max

I have Data from 2Files

File1

Sales ID | Sales Amount

1| 100

2| 200

 

File2

Sales ID | Budget Amount

1| 170

2| 290

 

I Want to pick the Max of (Sales amount and Budget amount) and put it in a new field . need to perform this on the Load script..

For Ex:  Sales ID | Sales Amount| Budget Amount|MaxCheck

                    1| 100|170|170

Labels (1)
2 Replies
Highlighted
Creator II
Creator II

Something like this?

Temp:
NOCONCATENATE
LOAD * // Data from File1
INLINE [
        Sales ID, Sales Amount
        1,        100
        2,        200
];

JOIN (Temp)
LOAD * // Data from File2
INLINE [
        Sales ID, Budget Amount
        1, 	  170
        2, 	  290
];

Final:
NOCONCATENATE
LOAD *,
     RangeMax([Sales Amount], [Budget Amount]) AS MaxCheck
RESIDENT Temp
;

DROP TABLE Temp;
Highlighted
Creator II
Creator II

When Iam running this to the whole data set i dont get the correct Rangemax results.. But when i using it in expression it works

For Ex: when running in script

Sales ID | Sales Amount| Budget Amount|MaxCheck

                    1| 100,987|187,654|190,356

 

when using in expression it works correct

Sales ID | Sales Amount| Budget Amount|MaxCheck

                    1| 100,987|187,654|187,654

 

But as i need this in load script.. as the file too huge and i would like store it in specific folder