Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

Peek function creating issue for Date

Hi All,

I want to determine the max date for my incremental load. But when I am using Peek function the variable is showing wrong format.

in source date is in below format:

My Script is:

Last_Date:

LOAD

Date (max(action_date$)) as MaxActionDate

FROM

(qvd);

let vMaxDate = Date(peek('MaxActionDate',0,'Last_Date'));

MaxActionDate is showing in right format:

But Variable vMaxDate is showing in wrong format:

Could you please help to get this correct.

Thanks,

Sarif

1 Solution

Accepted Solutions
sunny_talwar

I hope you are using your variable without the dollar sign expansion on the front end...

Use it as =vMaxDate instead of =$(vMaxDate)

View solution in original post

12 Replies
MK_QSL
MVP
MVP

Instead of Let use Set

Set vMaxDate = ........

sunny_talwar

Try like this

LOAD Max(action_date$) as MaxActionDate

FROM

(qvd);

LET vMaxDate = Date(Peek('MaxActionDate',0,'Last_Date'));

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Mohammad,

May it will help you:

Temp: 

Load 

               min(TransactionDate) as minDate, 

               max(TransactionDate) as maxDate 

Resident LinKTable; 

 

Let varMinDate = Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = Num(Peek('maxDate', 0, 'Temp')); 

DROP Table Temp; 

Thanks,

Arvind Patil

mhmmd_srf
Creator II
Creator II
Author

Hello Sunny ,

This is also not working. I am getting result like below:

sunny_talwar

I hope you are using your variable without the dollar sign expansion on the front end...

Use it as =vMaxDate instead of =$(vMaxDate)

Kushal_Chawda

try this

Last_Date:

LOAD

Date(floor(max(action_date$))) as MaxActionDate

FROM

(qvd);

let vMaxDate = peek('MaxActionDate',0,'Last_Date');

PrashantSangle

Date(maxActionDate);

Or

Timestamp(maxActionDate)

Regards,

Prashant

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
mhmmd_srf
Creator II
Creator II
Author

okk..it is working..

what happens if we put $?

sunny_talwar

6/30/2017 is evaluated as 6 divided by 30 divided by 2017....