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: 
Gabo77
Contributor III
Contributor III

Issue with comparing dates

Hi guys.

I know this will turn out to be nonsense but...

I having problems comparing 2 dates values.

First, we have a Variable defined like this:

Let vToday = Today();

Then, we're trying to load data from QVD file, that was previously filled from a SQLServer data using this commands.

HeadCountBase:
  Load PE_YEAR As Año, AU_FECHA As Fecha, PE_TIPO As Compañia, PE_NUMERO As Semana, CB_NIVEL2 As IdArea, CB_CODIGO As IdEmpleado
  From [lib://3.KPIsDH/1.QVD/1.Ext/EXT_Headcount.qvd] (Qvd)
  Where AU_FECHA < $(vToday);

I'm pretty sure that AU_FECHA have a Date format in table... since it comes like that from SQL, and i'm sure that QVD has values that complished the command conditions... but these command returns with 0 records.

Can enyone tell me what is wrong with this?

Regards!

Labels (3)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Try this.

Where AU_FECHA < '$(vToday)';

View solution in original post

5 Replies
BrunPierre
Partner - Master
Partner - Master

Hi, maybe like this?

Where Num(Date(AU_FECHA)) < Num(Today());

Gabo77
Contributor III
Contributor III
Author

Hi @BrunPierre ... Thanks but, it doesnt works... 😞

Gabo77
Contributor III
Contributor III
Author

@BrunPierre following your sample... i try this...

  Load PE_YEAR As Año, AU_FECHA As Fecha, PE_TIPO As Compañia, PE_NUMERO As Semana, CB_NIVEL2 As IdArea, CB_CODIGO As IdEmpleado
  From [lib://3.KPIsDH/1.QVD/1.Ext/EXT_Headcount.qvd] (Qvd)
  Where AU_FECHA < Today();

and it works... so... my question now is... why it doesn't work when i assign the value from Today() function to a variable and use this variable instead of Today() function?? 😞

BrunPierre
Partner - Master
Partner - Master

Try this.

Where AU_FECHA < '$(vToday)';

Gabo77
Contributor III
Contributor III
Author

Yes! it works! Thanks...