Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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,
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,
I have aldready test this it doesn't work. 😞
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,
Thank you very much!
It's work fine !