Skip to main content
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');

1 Solution

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

View solution in original post

16 Replies
Kushal_Chawda

I do not see any problem. What do you want in Variable?

Anonymous
Not applicable

Is your data sorted as per Date? What value is the variable returning?

Chanty4u
MVP
MVP

its correct syntax only.

Peek() or Previous() ?

kkkumar82
Specialist III
Specialist III

Hi Mahesh,

Can you attach your qvw file with some sample data

qlikview979
Specialist
Specialist
Author

Hi all,

please find the attached fine.

I am learning incremental load . i am using peek function for max date.

Chanty4u
MVP
MVP

hi ,

chk below threads for Inc load

Incremental Load in Qlikview - Sources

qlikview979
Specialist
Specialist
Author

Hi Kushal,

I want Max Date  from date field.

Regards,

Mahesh.

tresesco
MVP
MVP

Try like:

T1:

LOAD ID,

    PRODUCT,

    SALES,

    DATE

FROM

[.............................................................xlsx]

(ooxml, embedded labels, table is Sheet1);

Temp:

Load

          max(DATE) as MaxDate

Resident T1;

LET Vpeek1=peek('MaxDate');

Drop Table Temp;

kkkumar82
Specialist III
Specialist III

Mahesh , if you are looking for Incremental load then Tresco way is the correct or your may also Order by the data by Date field (provided if the dates are numeric) then you can use Peek to get the max value.