Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
shruthibk
Creator
Creator

how to round two numbers after decimal points?

Hi,

I want to round data after decimal point, if data is like this 345.444 then it should give 345.44 and if it is 3850.00 it should give only 3850 how can i achieve this in pivot chart?. i tried different approach in number format but ending up with unexpected result .

plz help me to achieve this

thanks,

shruthi

5 Replies
Marcio_Campestrini
Specialist
Specialist

Shruthi

I think it's better to padronize the format to one pattern.

If you need to do this, you can test if the information has decimals or not. If it has, you format with 2 decimals; if the information has no decimals, you format without decimals.

Márcio

Márcio Rodrigo Campestrini
maxgro
MVP
MVP

maybe

=replace(Round(345.444, 0.01), '.00', '')

ecolomer
Master II
Master II

Can you upload an simplified qv example

JonnyPoole
Employee
Employee

you should be aware of this little thing when using round()

Rounding Errors

There are some suggestions in the blog to avoid rounding errors.

Ex ->   If its 2 decimal places you want, Multiple by 100, round, divide by 100

Ex -> if its 3 decimal places you want, multiple by 1000, round, divide by 1000

Marcio_Campestrini
Specialist
Specialist

Hi

Have you solved your problem? If you did, please choose the correct answer and help us to keep community focused.

Márcio Rodrigo Campestrini