Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Variable

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');

16 Replies
Kushal_Chawda

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');

kkkumar82
Specialist III
Specialist III

Please find attached,

1. Using Order by

2. Using Max(Date)

qlikview979
Specialist
Specialist
Author

Hi Kushal,

Superb, Its working .

Regards,

Mahesh.

qlikview979
Specialist
Specialist
Author

Hi Kumar,

I got it,thanks for support.

Regards,

Mahesh.

qlikview979
Specialist
Specialist
Author

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.

Kushal_Chawda

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)

qlikview979
Specialist
Specialist
Author

Hi Kushal,

Got it, Thanks

Regards,

Mahesh