Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Qvmaster2019
Creator
Creator

LET Statement Not Working

I think I missed out something here. The variable I created is not showing at all in my variables tab.

Here is my code.

Dynamic:

LOAD Date as Dyn_Date,

     Week as Dyn_Week,

     Year as Dyn_Year

FROM

[..\DataSources\ExcelFiles\BookmarkTest\Dynamic.xlsx]

(ooxml, embedded labels, table is Raw);

Let vmaxDate = max(Dyn_Date);

Please help.

Regards,

Darwin

Labels (1)
1 Solution

Accepted Solutions
clisboa_noesis
Partner - Creator
Partner - Creator

Hi,

You can't do it like that.

You need to do a resident load on the table Dynamic:

Dynamic_MaxDate:

LOAD

     max(Dyn_Date) as MaxDate

Resident Dynamic;

then you can peek at the maxdate value.

LET vmaxDate = peek('MaxDate');

And now that we don't need dynamic_MaxDate we drop it:

drop table Dynamic_MaxDate;

Hope it helps.

Regards,

Carlos

View solution in original post

4 Replies
clisboa_noesis
Partner - Creator
Partner - Creator

Hi,

You can't do it like that.

You need to do a resident load on the table Dynamic:

Dynamic_MaxDate:

LOAD

     max(Dyn_Date) as MaxDate

Resident Dynamic;

then you can peek at the maxdate value.

LET vmaxDate = peek('MaxDate');

And now that we don't need dynamic_MaxDate we drop it:

drop table Dynamic_MaxDate;

Hope it helps.

Regards,

Carlos

m_woolf
Master II
Master II

Try:

Let vmaxDate = '=max(Dyn_Date)';

Qvmaster2019
Creator
Creator
Author

mwoolf wrote:

Try:

Let vmaxDate = '=max(Dyn_Date)';

mwoolf, this displays the vmaxDate in the Variables tab but not properly evaluating it.

Qvmaster2019
Creator
Creator
Author

Carlos, i will definitely try it now.

But the thing is, just yesterday, i think i was able to make it work by ticking on some options in Document Properties.