Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
cliff_clayman
Contributor II

Number Format for a calculated field in script

I have a field that I am calculating in my script and I can't seem to get the format correct.  Here is the code in my script to create the field:

 

Num(MonthsEnd(1,Today(),-1)-[Posting Date],'#,##0') as DaysAged

 

I want this to be a number without decimals.  When I look at the values in a list box, it looks fine, but when I export the data to Excel, I still see the decimals.  How can I make it a whole number when exporting to Excel?

Labels (3)
1 Solution

Accepted Solutions
Partner
Partner

Re: Number Format for a calculated field in script

try Num(round(MonthsEnd(1,Today(),-1)-OrderDate),'#,##0')
1 Reply
Partner
Partner

Re: Number Format for a calculated field in script

try Num(round(MonthsEnd(1,Today(),-1)-OrderDate),'#,##0')