Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rounding off!!!!!!!!

   HI All,

      I have a Expression in that i have Decimal part is there so i want to round off that one Like;

present Input:

CINDEX
74.00156
26.00783

I want to  get the this out put:

Cindex
74.1
26.1

can u help me how

thanks

14 Replies
JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Hi Suneel:

There are some rounding functions

1) Round

2) Ceil = Round Up

3) Floor = Truncate or Round Down

Hope it helps

Joaquin

amit_saini
Master III
Master III

Hi Suneel,

You this in your expression:

=Num(Your_Field,'##.#')

Thanks,
AS

nizamsha
Specialist II
Specialist II

u can use ceil,round,floor but how u  r bringing  ur output like that


74.1

JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

The last parameter of this functions is an offset.

You could round/floor/ceil to 0.003 or 0.04 or 0.7

Not only to 0 or to +1

Not applicable
Author

IF  it is 74.56217

I want round it to 74.6 like that

JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Hi


round( 2.4 ) returns 2

round( 2.6 ) returns 3

round( 2.5 ) returns 3

round( 3.88 , 0,1 ) returns 3,9

round( 3.88 , 5 ) returns 5

round( 1.1 , 1 , 0.5 ) returns 1,5

Have a look at the online help

kogasawara
Partner - Creator
Partner - Creator

try ceil function!!

load ceil(ceil(ceil(Ceil(CINDEX,'0.0001'),'0.001'),'0.01'),'0.1') as CINDEX inline

[

CINDEX

74.00156

26.00783

74.56217

];

Not applicable
Author

Try this,

Ceil(CINDEX,'00.1',1)

-Prabhu

JoaquinLazaro
Partner - Specialist II
Partner - Specialist II

Hi Sunil

If you have 74.01 and you want 75 you must use Ceil

If you have 74.99 and you want 74 you must use Floor

If you have (74.01 to 74.49 and want 74) or (74.50 to 74.99 and want 75) you must use Round

Three functions works with some decimals