Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sql data in variable

Hi everyone !

I need to bring one value (date) from sql server to  a variable in qlikview and after make a tratative this of data  , the problem is that variable always stay null.

follow part of the code

LET MinDate = floor(date(VStartAno, 'DD/MM/YYYY'));

cld_temp:

SQL

  SELECT MAX(Data) as Dstx FROM time_dimension;

xtemp:

LOAD  floor(date(Dstx ,'DD/MM/YYYY'))

Resident  cld_temp;

LET MaxDate = Dstx;

DROP TABLE cld_temp;

DROP TABLE xtemp;

the maxdate stay null, and would should to stay like 41630.

someboy have some idea ?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Try using the peek function:

LET MinDate = floor(date(VStartAno, 'DD/MM/YYYY'));

cld_temp:

SQL SELECT MAX(Data) as Dstx FROM time_dimension;

LET MaxDate = peek('Dstx');

drop table cld_temp;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Try using the peek function:

LET MinDate = floor(date(VStartAno, 'DD/MM/YYYY'));

cld_temp:

SQL SELECT MAX(Data) as Dstx FROM time_dimension;

LET MaxDate = peek('Dstx');

drop table cld_temp;


talk is cheap, supply exceeds demand
Not applicable
Author

worked, thanks!!