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

Cut a Decimal off at a Certain spot without Rounding

I have decimals that are computed in our system and come out to something like this 0.197378 that it cuts down to 0.1973 on reports. When I limit the decimal places in QlikView it becomes 0.1974. I have tried using the num function and cannot seem to get the floor function to work, so I wanted to see if there was another way to cut numbers off at a certain decimal and not round them.

1 Solution

Accepted Solutions
SunilChauhan
Champion
Champion

in GPD use below expression

floor(num(Sum(Gain_lbs_b) /  SUM(Processed_head) / Round((sum(AgeInDays * Processed_head) / SUM(Processed_head)), 1.0),'#.####'),.0001)

hope this helps

Sunil Chauhan

View solution in original post

16 Replies
jerem1234
Specialist II
Specialist II

I would think something like:

floor(Field, .0001)

would work.

Anonymous
Not applicable
Author

When I put my expression in the floor function it does not compute, but the num function does. Any idea why?

jerem1234
Specialist II
Specialist II

Hmm could you post a small sample qvw that demonstrates this?

Not applicable
Author

Maybe Floor(num(Field),.0001)

Anonymous
Not applicable
Author

This runs with no errors, but doesn't return a result.

Not applicable
Author

Not sure why its not working for you. Attached is a sample. Is the number in number format?

SunilChauhan
Champion
Champion

=floor(num(0.197378,'#.####'),.0001)

or

floor(num(fieldname,'#.####'),.0001)

Sunil Chauhan
Anonymous
Not applicable
Author

Does it matter that I am trying to do this in a calculated expression in a chart?

SunilChauhan
Champion
Champion

you can attached sample

we will have a look

Sunil Chauhan