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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
leenlart
Creator
Creator

variable with Makedate not comparing to database date

Hello, 

I have loaded a table from a database.  

I would now like to select all the lines from that inital table where the date is equal to the last day of the previous month.  For testing purposes, I set my date to 

LET vMoisProvisions = MakeDate(2018,9,30);

Now my resident load does this :

resident Situations
where num(DATESIT) = num($(vMoisProvisions)) ;

The resident load is returning nothing.  

My datesit looks like 43373 if I stick it in a text box or a list box.  

If I do a text box with num($(vMoisProvisions)) I also get 43373.  

When I put in the following line in my load script and debug I get 0,001651....  

vMoisProvisions = num($(vMoisProvisions));

So what is going on here?  How can I compare my vMoisProvisions to the DATESIT correctly?

 

1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

Maybe this:

where num(DATESIT) = num('$(vMoisProvisions)') ;

View solution in original post

4 Replies
Frank_Hartmann
Master II
Master II

Maybe this:

where num(DATESIT) = num('$(vMoisProvisions)') ;
leenlart
Creator
Creator
Author

That works.  

Thanks!

Now can you explain why this works ?  

ckarras22
Partner - Creator
Partner - Creator

It is needed to be enclosed in quotes as it is a date. Otherwise in Num() will be extracted something like 29/11/2018, which is a division. That's why you get such a number (0,001651). 

leenlart
Creator
Creator
Author

Hey, 

Thanks so much for taking the time to explain this!