Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
pauluk__
Contributor III
Contributor III

Num expression as integer when integer, else 1 decimal place

Hi,

I'm trying express a mix of different numbers as either an integer or to 1 decimal place.

Is there anything I can do just in the Num expression that would achieve this?

Num(Sum(Number), '#,##0.0') places everything at 1 decimal place, even integers.

Thanks for the help.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

You may try conditional statement like:

=If(floor(Variable1)=Variable1, Variable1, Num(Variable1,'#,##0.0'))

Now replace Variable1 with your expression.

View solution in original post

3 Replies
Anil_Babu_Samineni

Even Integer means, Do you have any different Types. Would you provide sample data and expected result?

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
tresesco
MVP
MVP

You may try conditional statement like:

=If(floor(Variable1)=Variable1, Variable1, Num(Variable1,'#,##0.0'))

Now replace Variable1 with your expression.

pauluk__
Contributor III
Contributor III
Author

Hi,

Yes that is a good way of checking this thanks. I was looking more to see if it was possible in the Num expression formatting?