Discussion Board for collaboration on QlikView Scripting.
I have the months coming after loading the script are like below
I have to find the latest month and store in the variable in this case its Jun
I can use peek function like this trim(Peek('Month')); but the problem is the month order is not fixed,may be next month it will come like below
In this case I want Aug to store in variable.
Please help me
Go to Solution.
Try like this
Date(Date#(Month, 'MMM'), 'MMM') AS Month
max(Month) as MaxMonth
let vMaxMonth = peek('MaxMonth',0,'MaxMonth');
If in script you have created the Month using Month(Date) as Month , then you can directly write max(Month) in variable
Trying using Max(Month)
LOAD Month(Date#(Month,'MMM')) as Month Inline [ Month Jan Feb Apr Mar Jun Aug ];
then in QlikView if you use MaxString(Month) you will Get AUG
How you are deriving month field in the script? If you are deriving by using Month() then you can directly use
Month is coming from the text file and I am not converting it in any month format using QlikView function.I did that too but it is not working.
Now you can use Max(Month)
I have to create the variable in the script itself and when I am using Max there it is not returning any value
Please use the below script:
date(DATE) as DATE,
num(Month(date(DATE))) as Month_Num,
(ooxml, embedded labels, table is Sheet1);
Load max(Month_Num) as Max_Month
Let vMaxMonthNum= peek('Max_Month',0,'Max_Month');