Calculation error

Stimulsoft Ultimate discussion
Post Reply
harundemir13
Posts: 28
Joined: Thu Aug 01, 2019 1:22 pm

Calculation error

Post by harundemir13 »

Hello,
When I calculated division between two fields that I got some error in preview.
Example
val_1=2, val_2=1 => DATA.val_1/DATA.val_2 =1 its working

val_1=1, val_2=2 => DATA.val_1/DATA.val_2 = 0 its not working so be results 0.5

val_1=0, val_2=0=> DATA.val_1/DATA.val_2= its not working there is any show data so be results 0

You will find example report file and data file

Thank you
Attachments
Report.mrt
(9.12 KiB) Downloaded 97 times
New Text Document.csv
(26 Bytes) Downloaded 104 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Calculation error

Post by Lech Kulikowski »

Hello,

We couldn't reproduce the issue. Please clarify what product and version are you use.

Thank you.
harundemir13
Posts: 28
Joined: Thu Aug 01, 2019 1:22 pm

Re: Calculation error

Post by harundemir13 »

Hello,
Version is Stimulsoft Designer v2022.4.2 and you will find screen shots also all of them types integer
Thank you
Attachments
XP7nYJgtrz.jpg
XP7nYJgtrz.jpg (16.56 KiB) Viewed 1242 times
FZXzqutJ0J.jpg
FZXzqutJ0J.jpg (37.18 KiB) Viewed 1242 times
5ZahpprG6b.jpg
5ZahpprG6b.jpg (7.37 KiB) Viewed 1242 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Calculation error

Post by Lech Kulikowski »

Hello,

Please check the following expression:
{(val_2!=0 ? val_1/val_2 : 0)}

Thank you.
harundemir13
Posts: 28
Joined: Thu Aug 01, 2019 1:22 pm

Re: Calculation error

Post by harundemir13 »

Hello,
Thank you for response. I understood your answer and I will try it. How can I use when val_1=1 lower than val_2=2 ? Because it's result be 0.
Thank you.
Attachments
9v3egtzIrm.jpg
9v3egtzIrm.jpg (14.5 KiB) Viewed 1229 times
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Calculation error

Post by Lech Kulikowski »

Hello,

Your column is Int, please change it on the decimal, for example.

Thank you.
harundemir13
Posts: 28
Joined: Thu Aug 01, 2019 1:22 pm

Re: Calculation error

Post by harundemir13 »

Hello,
I tried your method and it worked.
Thank you
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Calculation error

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply