# How make a condition for -ve and +ve of the same calculated number number?

**URL:** <https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340>\
**Category:** Questions about Thunkable X\
**Created:** [September 29, 2024, 6:22am UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340 "2024-09-29T06:22:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aswinchandrasekharan](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@aswinchandrasekharan](https://community.thunkable.com/u/aswinchandrasekharan)\
**Post date:** [September 29, 2024, 6:22am UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/1 "2024-09-29T06:22:30Z")

</div>

Hi i am trying to make a condition where an error message is shown under a certain criteria.

Some numbers are entered in the text boxes. A block calculates a value from some of those numbers and shows it. For example value shown = x+y+z.

Now i need to setup a condition where the error message is shown when (x+y+z) \> [+ve (10xA +5)] and [(x+y+z) \> [-ve (10xA +5)]

I need some advice on how to set up this +ve and -ve condition for the same derived value?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [September 29, 2024, 2:53pm UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/2 "2024-09-29T14:53:21Z")

</div>

You can use the AND logic block to connect to conditions together. But how can x+y+z be \> ve and \> -ve? Did you mean to turn around one of those inequalities?

If you’re stuck, post a screenshot of what you’ve tried and someone can probably help you fix it.

---

<div class="post-metadata">

**Author:** ![aswinchandrasekharan](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@aswinchandrasekharan](https://community.thunkable.com/u/aswinchandrasekharan)\
**Post date:** [September 30, 2024, 11:56am UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/3 "2024-09-30T11:56:24Z")

</div>

I dont have a condition setup yet for that. I was stuck at how to.

I can explain a little further so you get the idea.

The app has a few text boxes for some fuel figures from different tanks. Once a calculate button is clicked the app calculates the various uplift figures and discrepancies. I have managed to do that much. Now the issue is as follows

Eg: discrepancy is calulated by app

The limit discrepancy can be is within (+ or -) y

Now y= 0.0072(A) + 537.5  
Where A is one or the text box values in the app called final fuel on board.

If lets say (A) = 100000  
So if we get discrepancy as +2000 from the app. Based on the “y” calculation, discrepancy is \> y so error message shown.

But the same must be true of the discrepancy is -2000 as well. This is where i am having a problem. Coz this y equation is only gonna give me a +ve value so its easy to put a condition for the +2000 (for eg). Ut how do i also set it up for the -2000?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [September 30, 2024, 10:33pm UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/4 "2024-09-30T22:33:14Z")

</div>

What you’ve written in the two posts are contradictory. They can’t both be true. You’re saying on the one hand:

If D (discrepancy) \> y then show error  
If -D \> y then show error

But for any value of y less than D, that is going to show an error, because if something is less than -D, it’s also less than D.

Then you also said that D can be within +/- y. So I would think that means D \> y \> -D.

But that’s different! In that case, y has to be between -2000 and 2000. So… which is it?

---

<div class="post-metadata">

**Author:** ![anandavardhana57zwwl](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anandavardhana57zwwl](https://community.thunkable.com/u/anandavardhana57zwwl)\
**Post date:** [October 1, 2024, 10:10pm UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/5 "2024-10-01T22:10:37Z")

</div>

Hi Aswin,

I think this is what you mean. Assume the  
PL = +ve Limit is 10 and NL = -ve limit is -10 then  
if (x+y+z) \> 0 & (x+y+z) \> PL) Error Out  
if (x+y+z) \< 0 & ABS(x+y+z) \> ABS( NL)) Error Out  
ABS means absolute value  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/f/8f2b2e749c97c5de2750908b0e58876250ba09ae.png)  
& means “and”  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/a/9afeac47c010c15b6c5712c54ccf502580f95ac3.png)  
All the above conditional checking can be easily done with Thunkable

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [December 30, 2024, 10:10pm UTC](https://community.thunkable.com/t/how-make-a-condition-for-ve-and-ve-of-the-same-calculated-number-number/3235340/6 "2024-12-30T22:10:48Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
