Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Format number in load script

Hi everyone,

Need a little help in getting my number format right in my load script.  Here is what I have.......but not working.

Thanks in advance.

Num((if(Len(trim(Acq_Hire_Date) > 0), Num(LastWorked_Date) - Num(Acq_Hire_Date), Num(LastWorked_Date) - Num(HireDate)) / 365,'00')) as [LOS]

1 Solution

Accepted Solutions
tmumaw
Specialist II
Specialist II
Author

Got it to work.  Thanks everyone for your help.

Num((if(Len(trim(Acq_Hire_Date) > 0), Num(LastWorked_Date) - Num(Acq_Hire_Date), Num(LastWorked_Date) - Num(HireDate)) / 365),'00') as [LOS] 

View solution in original post

9 Replies
eespiritu
Creator
Creator

Hi Thom,

Try this:

Num((if(Len(trim(Acq_Hire_Date) > 0), Num(LastWorked_Date) - Num(Acq_Hire_Date),Num(LastWorked_Date) - Num(HireDate)) / 365,'#,##0.00')) as [LOS]


Regards,


Enrique.

sunny_talwar

May be this

Num(

(If(Len(trim(Acq_Hire_Date) > 0,

     LastWorked_Date - Acq_Hire_Date,

     LastWorked_Date - HireDate)/365),

'00') as [LOS]

Anil_Babu_Samineni

May be try this?

If(Len(Trim(Acq_Hire_Date))>0, Num(LastWorked_Date - Acq_Hire_Date), Num((LastWorked_Date - HireDate)/365)) as LOS


Split to diff expressions and then try

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
tmumaw
Specialist II
Specialist II
Author

nope

tmumaw
Specialist II
Specialist II
Author

nope

sunny_talwar

Can you share a screenshot?

Anonymous
Not applicable

Num((if(isnull(Acq_Hire_Date),Num(LastWorked_Date) - Num(HireDate), Num(LastWorked_Date) - Num(Acq_Hire_Date)) / 365,'00')) as [LOS]

tmumaw
Specialist II
Specialist II
Author

Got it to work.  Thanks everyone for your help.

Num((if(Len(trim(Acq_Hire_Date) > 0), Num(LastWorked_Date) - Num(Acq_Hire_Date), Num(LastWorked_Date) - Num(HireDate)) / 365),'00') as [LOS] 

sunny_talwar

Great, if you got what you wanted, I would suggest closing this thread by marking your own response as the correct answer.

Best,

Sunny