Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
bhaveshp90
Creator III
Creator III

How to round up the values in the expression ?

Hello,

I have Net_Risk_Position as a dimension in my table with values as shown below;

Net Risk Position
(R)44000
(R)91255.394516
(C)-79240
(R)4587.658936
(R)19875

How to write an expression to round up the values to 2 decimals as shown below;

Net Risk Position
(R)44000.00
(R)91255.39
(C)-79240.00
(R)4587.66
(R)19875.00

thanks

Bhavesh

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Another way using Mid() function can be like

Left([Net Risk Position],3)&Num(Mid([Net Risk Position], Index([Net Risk Position],')')+1,Len([Net Risk Position])), '###0.00') AS NetPost

View solution in original post

4 Replies
settu_periasamy
Master III
Master III

Try this

LOAD Left([Net Risk Position],3)&Num(SubField([Net Risk Position],')',-1),'###.00')         as [Net Risk Position];
LOAD * INLINE [
Net Risk Position
(R)44000
(R)91255.394516
(C)-79240
(R)4587.658936
(R)19875
]
;

vishsaggi
Champion III
Champion III

Another way using Mid() function can be like

Left([Net Risk Position],3)&Num(Mid([Net Risk Position], Index([Net Risk Position],')')+1,Len([Net Risk Position])), '###0.00') AS NetPost

bhaveshp90
Creator III
Creator III
Author

Perfect, that worked out for me. thank you

bhaveshp90
Creator III
Creator III
Author

thank you for your response, but I have 2 million records to convert.