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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator 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 (2)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

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

View solution in original post

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

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