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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date of comparison in the script (Comparaison de date dans le script)

Hello,

I have a problem on a formula or want to compare two dates in the script.

if ([Date of last exit] = Date (monthend ([Date of last exit]) DD-MM-YYYY '),' ',' X '),

I tried several syntaxes trying to force the formats of the dates but nothing happens!

As you can see on the screen I should not see the 'X' in the last column in the rectangle framed as the last exit date equals the date LAST_DAY.

If someone an idea!

Thank you in advance!

Translated with Google Translate - Qlik Community Administrative Team

Bonjour,

Je rencontre un problème sur une formule ou je désire comparer deux date dans le script.

if([Date de dernière sortie]=Date(MonthEnd([Date de dernière sortie]),'DD-MM-YYYY'),'','X'),

J'ai essayé plusieurs syntaxes en essayant de forcer les formats des dates mais rien n'y fait!

Comme vous le voyez sur l'ecran je ne devrais pas voir la 'X' dans la dernière colonne dans le rectangle encadrée car la Date de derniere sortie est égale à la Date Last_Day.

Si quelqu'un à une idée!

Merci d'avance!

Formule Date.png

Formule Date 2.png

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

From the help:

monthend ( '2001-02-19' ) returns '2001-02-28' with an underlying numeric value corresponding to '2001-02-28 23:59:59.999'

So to compare try with the function floor to remove the timestamp part

if([Date de dernière sortie]=Floor(MonthEnd([Date de dernière sortie])),'','X') as MyNewField,

View solution in original post

4 Replies
stigchel
Partner - Master
Partner - Master

Not sure because not the complete script is shown But in the script you've pasted there seems to miss a Fieldname before the ,

if(Date([Date de dernière sortie])=Date(MonthEnd([Date de dernière sortie])),'','X'),

should be

if(Date([Date de dernière sortie])=Date(MonthEnd([Date de dernière sortie])),'','X') as MyNewField,

Anonymous
Not applicable
Author

I have aldready test this it doesn't work. 😞

stigchel
Partner - Master
Partner - Master

From the help:

monthend ( '2001-02-19' ) returns '2001-02-28' with an underlying numeric value corresponding to '2001-02-28 23:59:59.999'

So to compare try with the function floor to remove the timestamp part

if([Date de dernière sortie]=Floor(MonthEnd([Date de dernière sortie])),'','X') as MyNewField,

Anonymous
Not applicable
Author

Thank you very much!

It's work fine !