Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
tmumaw
Valued Contributor

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]

Tags (1)
1 Solution

Accepted Solutions
tmumaw
Valued Contributor

Re: Format number in load script

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] 

9 Replies
eespiritu
Contributor

Re: Format number in load script

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.

Re: Format number in load script

May be this

Num(

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

     LastWorked_Date - Acq_Hire_Date,

     LastWorked_Date - HireDate)/365),

'00') as [LOS]

Re: Format number in load script

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tmumaw
Valued Contributor

Re: Format number in load script

nope

tmumaw
Valued Contributor

Re: Format number in load script

nope

Re: Format number in load script

Can you share a screenshot?

atkinsow
Valued Contributor II

Re: Format number in load script

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

tmumaw
Valued Contributor

Re: Format number in load script

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] 

Re: Format number in load script

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

Best,

Sunny