Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Specialist

Round off number giving incorrect results qliksense

Hello All,

I have below table in qliksense:-

Aspiring_Developer_0-1643643979561.png

For "vs Target" column  my measure is Column (1) - Column(2) (i.e 99.9-99.9). But the result is coming in -0.0. Although , it should show simple 0.0 .

As I am using vizlib , we have selected to showcase the negative numbers in parenthesis.

Aspiring_Developer_1-1643644115297.png

So, I changed the number formatting of the columns and selected to show "2  decimal places " like below :-

Aspiring_Developer_2-1643644249466.png

 

Now it gives me the below output :-

Aspiring_Developer_3-1643644303957.png

 

 

The negative sign is removed.

 

But my requirement is to show the numbers in single decimal . However, it is causing issue. Not sure , how to resolve this ?

Can anyone please help ?

Thanks in advance.

4 Replies
rwunderlich
Partner Ambassador/MVP

Change your expression to 

Round(Column (1) - Column(2), .1)

Alternatively, you may want to apply Round to your Actual & Target expressions instead. 

-Rob

Aspiring_Developer
Specialist
Author

Hello @rwunderlich 

When I apply the round function , it is showing me 0.0 .

However , the output should be a negative number (99.86-99.87= -0.01).  After applying round off the output is coming 0.0 without negative sign. In my expression we have set in the setting that negative number should be displayed in parenthesis , So my out out -0.01 should display as (0.01) and if we apply round off , it should come (0.0).

 

But since i am applying round off in my actual and target expression , it shows numbers as :-

99.9 -99.9 

and the target expression comes as 0.0 (column 1 -column 2) which is correct.

But i want to show the out put as -0.01 

joe_warbington
Luminary Alumni

While I understand what you're going for, you need to be careful on rounding and dropping those values. The values are computed correctly in the Qlik engine before being presented. A cautionary tale:  https://www.linkedin.com/posts/switch-rcm_underpayments-ai-undercharging-activity-689179640620688589... 

chris_djih
Creator III

when you use Column. you will exactly calculate with the shown values.
speaking clear: if you user Round(Sum(X)) in your column 1 and Round(Sum(Y) in column 2.
column 1-column2 will calculate exactly the difference of the rounded values.
What you want to display instead is on the one hand: the rounded values in the columns, but the more correct value in the difference column. So you have to use the original formulas instead of column:

round( Sum(x)-Sum(y), 0.001) or whatever accuracy you need.

the display of -0.0 is correct and important, since it is a notice to the user that there is in fact a negative outcome, but due to the format it is rounded to zero. so 0.0 would  mean there is no actual difference. -0.0 means there is a difference, but so small that it is rounded to 0.0

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.