Skip to main content
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
Anil_Babu_Samineni

May be work like below?

LOAD Num(Month(Date(Date#(dateJo,'DD-MMM-YY')))) as dateJo Inline [

dateJo

1-Apr-17

1-Jan-17

];

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
Anil_Babu_Samineni

Date may not necessary, But some case it will help you. For now, Even this will work

Num(Month(Date#(dateJo,'DD-MMM-YY'))) as dateJo

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
soniasweety
Master
Master
Author

thanks anil its working but

am concatenating two tables with same column  but

in one column   values showing like   1-Apr-17    and other table column values like below  2017-10-01 00:00:00.000

so how to workout this?  to get same result?

sasikanth
Master
Master

HI ,

Try this

Num(Date#(dateJo, 'DD-MMM-YY')) as DateNum

Anil_Babu_Samineni

I believe this should work

LOAD Num(Month(Date(Date#(dateJo,'DD-MMM-YY')))) as dateJo Inline [

dateJo

1-Apr-17

1-Jan-17

];

Concatenate

LOAD Num(Month(Date(Date#(dateJo,'YYYY-MM-DD hh:mm:ss.fff')))) as dateJo Inline [

dateJo

2017-10-01 00:00:00.000

];

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
PrashantSangle

Use Alt()

See in help menu

Regards,

Prashant Sangel

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

Hi Try this,

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

Inline [

dateJo

1-Apr-17

17-Jan-01

];

Anil_Babu_Samineni

This is not going to work, You need

sasi k wrote:

Hi Try this,

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

Inline [

dateJo

1-Apr-17

17-Jan-01

];

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
soniasweety
Master
Master
Author

none of above working   its giving null