Page 1 of 1

Calculation error

Posted: Mon Oct 10, 2022 2:02 pm
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

Re: Calculation error

Posted: Tue Oct 11, 2022 11:45 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: Calculation error

Posted: Tue Oct 11, 2022 1:26 pm
by harundemir13
Hello,
Version is Stimulsoft Designer v2022.4.2 and you will find screen shots also all of them types integer
Thank you

Re: Calculation error

Posted: Tue Oct 11, 2022 7:54 pm
by Lech Kulikowski
Hello,

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

Thank you.

Re: Calculation error

Posted: Wed Oct 12, 2022 6:30 am
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.

Re: Calculation error

Posted: Wed Oct 12, 2022 8:37 am
by Lech Kulikowski
Hello,

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

Thank you.

Re: Calculation error

Posted: Wed Oct 12, 2022 9:12 am
by harundemir13
Hello,
I tried your method and it worked.
Thank you

Re: Calculation error

Posted: Wed Oct 12, 2022 10:38 pm
by Lech Kulikowski
Hello,

You are welcome.