Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

null coming in script

Hi All,

I had written script and null value is coming for variable. But that variable is having some value.

Inserts:

LOAD *FROM

$(Vqvdpath)fact_site_visit.QVD (qvd);

MaxDates:

LOAD Max(site_visit_updated_datetime) as MaxDate

Resident Inserts;

LET vMaxDate = Peek('MaxDate',0,'MaxDates');

DROP TABLE MaxDates;


In above for vMaxDate  null value is coming. But it is having max value. Where it is wrong. I think my script is correct. Can anyone tell me where it is going please guide me

11 Replies
NareshGuntur
Partner - Specialist
Partner - Specialist

Hope you have checked the count of the table MaxDates before dropping it.

sasikanth
Master
Master

HI,

are you able to load the data ? if not check '\' there in that variable or not

LOAD *FROM

$(Vqvdpath)fact_site_visit.QVD (qvd);

LOAD *FROM

$(Vqvdpath)\fact_site_visit.QVD (qvd);

Check site_visit_updated_datetime format

Anonymous
Not applicable
Author

Thanks for your reply. I am able to load the data. Only when I do max there it is creating problem.

Date format is dd/mm/yyy hh:min:ss

sasikanth
Master
Master

can you share your QVD ? with limited load

markodonovan
Specialist
Specialist

Hi Kumar,

Could you remove the DROP TABLE MaxDates; and check the table viewer to check the table is being created correctly.


If you could upload an app it would be helpful.


If the QVD is loading OK there shouldn't be a problem.


Thanks


Mark


Anonymous
Not applicable
Author

Syntax looks okay, if you can share some sample data or app, would be great?

You may also try like this?

Inserts:

LOAD *FROM

$(Vqvdpath)fact_site_visit.QVD (qvd);

MaxDates:

LOAD Max(site_visit_updated_datetime) as MaxDate

Resident Inserts

where site_visit_updated_datetime<>' ';

LET vMaxDate = Peek('MaxDate',0,'MaxDates');

DROP TABLE MaxDates;

Anonymous
Not applicable
Author

my QVD is having 20 gb of data.

sasikanth
Master
Master

conditional load can help

Load * from qvd where condition;

Not applicable
Author

To debug the issue enable log file and add trace function to your variable values.

Your script looks correct. I would say, do drop the maxdates tables and check the MaxDate have the value or not.

What is your date format in "site_visit_updated_datetime" ?