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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

convert to num

Hi all

I have a field like   dateJo   values like   1-Apr-17   ,1-Jan-17  like so on

when I tried   num(dateJo) as  NewDate   it is giving me null

how to convert this?

15 Replies
PrashantSangle

can you post your script??

if possible provide sample data.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anil_Babu_Samineni

Have you tried at least? Copy and paste then reload() and show the image of field to check

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
sasikanth
Master
Master

HI,

i think there might be an issue with date format,

try this

LOAD  alt(num(Date#(dateJo,'DD-MMM-YY')),num(Date(dateJo,'DD-MM-YYYY' ))) as NewDate

Inline [

dateJo

1-Apr-17

17-Jan-01

];


OR


LOAD  alt(num(Date#(dateJo,'DD-MMM-YY')),num(Date(Date#(dateJo,'DD-MM-YYYY hh:mm:ss'  )))) as NewDate

Inline [

dateJo

1-Apr-17

17-Jan-01

];


sasikanth
Master
Master

HI,

Code works with out any issues & it will convert a date into number, usage of Month() function will give you month number.

shiveshsingh
Master
Master

try this

=num(DATE(Date#(Field,'DD/MM/YYYY'),'mm/dd/yy)')

luciano_garcia
Contributor III
Contributor III

Hi soniasweety

Check the existence of special chars in your column data (as TAB, or hair spaces, or thin spaces, e.g.)