Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Here my variable is not working .any one explain me why its not working.
T1:
LOAD ID,
PRODUCT,
SALES,
DATE
FROM
[.............................................................xlsx]
(ooxml, embedded labels, table is Sheet1);
LET Vpeek1=peek('DATE',-1,'T1');
Hi Mahesh,
You need to first sort the Data
T1:
LOAD ID,
PRODUCT,
SALES,
DATE
FROM
[.............................................................xlsx]
(ooxml, embedded labels, table is Sheet1);
T2:
LOAD *
Resident T1
order by DATE ASC;
drop table T1;
LET Vpeek1=peek('DATE',-1,'T2');
Please find attached,
1. Using Order by
2. Using Max(Date)
Hi Kushal,
Superb, Its working .
Regards,
Mahesh.
Hi Kumar,
I got it,thanks for support.
Regards,
Mahesh.
Hi Kushal,
Here I have one Doubt my DATE fields are ascending order right
DATE
5/1/2016 |
5/2/2016 |
5/3/2016 |
5/4/2016 |
5/5/2016 |
Why should we write ascending order in script.
Can you Explain me once.
Rehards,
Mahesh.
You can do the ascending or descending based on your need. Here as per the variable used peek function in -1 indicates last record of the Data i.e Date .. So we did order bye ascending to pick Max Date. But if you need both Min and Max then You should take resident and Use min(Date) and max(Date)
Hi Kushal,
Got it, Thanks
Regards,
Mahesh