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

Deleting decimals

Hi,

I'm a novice and it's difficult to use Qlikview within trainee.

I want to remove figures after comma and choose how many i remove

.

It's my expression and how I could make to remove figures after comma?

=(365*24-SUM({$<AnnéeDateCréationOT = {"= $( =Only(Tempyearname))"  }> }  Interval([Date fin intervention]-[Date création DI],'h')))/Count(ID_OT)

ex : 2, 34456

ex : 2, 34

Thanks

4 Replies
Anonymous
Not applicable
Author

use subfiled function like

something like this

=subfiled(expression,',',1)

hope it helps

Raj

jpapador
Partner - Specialist
Partner - Specialist

If you are doing this within a chart go to the number tab and choose the Fixed To option and choose 2 decimal places.  If you are doing this else where you can wrap the expression in a num() function like so:

Num((365*24-SUM({$<AnnéeDateCréationOT = {"= $( =Only(Tempyearname))"  }> }  Interval([Date fin intervention]-[Date création DI],'h')))/Count(ID_OT), '#,##0.00')

Not applicable
Author

Hi,

You have to use :

=num(yourNumber Or Expression, '0,00' ) --> x,xx

=num(yourNumber Or Expression, '0,0000' ) --> x,xxxx

Regards

Gysbert_Wassenaar

If you want to really remove the decimals you can use the floor function. For example to keep two decimals: floor( ...myexpressionhere... , 0.01)

If you want to keep the decimals, but only display with a number of decimals of your choice then you can use then num function.

The difference is that with num the fraction will still exist and used if the result of the expression is used in calculations (like sum). Floor will really cut off the fraction so it will not be used in further calculations.


talk is cheap, supply exceeds demand