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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator III
Creator III

Date Format Changes

How to change number format to date format?

Example Number:-693593



I am using DATE(-693593  ) function.getting 01-01-0001.

how to convert  -693593  to  01-01-2001 ????

Labels (1)
20 Replies
tresB
Champion III
Champion III

Do you have a field with such many negative values? If yes, please post few more such values and expected output dates against them, so that we could figure out a formula.

gireesh1216
Creator III
Creator III
Author

Hi please see last replay...

gireesh1216
Creator III
Creator III
Author

No...I am getting only one negative value that is (-693593) only...

tresB
Champion III
Champion III

Then you may try a static fix like:

Date(If( [Termination Date]<0, MakeDate(2001,1,1), [Termination Date])) as [Termination Date]

gireesh1216
Creator III
Creator III
Author

This expression is true?

=date(if(Termination_date='-693593','36892',Termination_date))

please help me

vcanale
Partner - Creator II
Partner - Creator II

Hi,
if you test it in a text object
=date('01-01-01') returns 01/01/2001
=date('01-JAN-01') returns '-'
with an INLINE tbl or something else try to find a way to convert JAN to 01
check also the SET DateFormat in your script

Anil_Babu_Samineni
MVP
MVP

Yes, this is true this will give 01-01-2001 only. But, tresco solution is bit make sense

Try over there

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tresB
Champion III
Champion III

I would prefer a numeric comparison (removing quotes) like:


date(if(Termination_date=-693593 ,36892,Termination_date))

rwunderlich
MVP
MVP

‌MIguel,

I'm not sure what this particular date number represents, but date numbers can be negative for dates prior to Dec 31, 1899.

Rob

Miguel_Angel_Baeyens
Support
Support

Rob,

I should have been more specific, while technically they can be whatever length and sign, I don't think you ever analyze anything prior to 1899, so if you are getting negative numbers for dates that implies either a zero date (whatever is in the source system) or bad formatting.

I'll correct my prior post with this regard.

Miguel

EDIT: Actually, 01/01/0001 is a valid date. However, I hesitate you have anything which happened on 01/01/0001.