Jump to content
Server Maintenance This Week. ×

Simple Calculation How to do it ?


This topic is 5575 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Dear All,

Cf. my attached file.

I am trying to do something who seems quiet simple:

I have a field called Total.

I would like that when:

1/ Input a number in the field Add to Quantity it do the addition of this number into the Total Quantity field.

2/ Input a number in the field Remove of Quantity it subtract this number into the Total Quantity field.

How could i do this ?

Thanks a lot for your help !

Cheers

pictur.png

Link to comment
Share on other sites

I responded but deleted it. I'm unsure what you are trying to accomplish. If you have a Total calculation and you have two fields (one to add and one to subtract) then the Total calc would be simply:

Add to Quantity - Remove from Quantity

But I've the feeling I'm missing something else you are looking for. Can you give examples of exact how you expect the Total field to behave if you enter something in each of the fields - give us a sequence of 3-4 entries so we can see the pattern you wish to achieve. In other words, if you have a 3 in the Add field, do you want it to add to the Total but then if you change the Add number, it adjust (so the Add and Remove always equal Total) or do you want to use the Add and Remove like a calculator with the figures adjusting each time?

LaRetta :wink2:

Edited by Guest
Modified
Link to comment
Share on other sites

Hello,

Thanks for your answer dear.

But there is still a problem:

When i input a number inside the field add to quantity or remove of quantity it well do the calculation.

Only problem, when i try to delete the number i inputed in the field add to quantity systematically the number one appears in the field.

It should be great that after you input a number inside the add or remove field, the number inputed automatically disappear.

Do you know how i could fix this ?

Thanks a lot for ur help.

Link to comment
Share on other sites

Okay, I find your response a bit difficult to follow. Please repeat it using different words and, give me example of the keystrokes (adding and deleting a number) and how the total field should accumulate your results. Then we can adjust accordingly. :smile2:

Link to comment
Share on other sites

Hello,

What Is happening:

1/ I write the number 500 in the field add to quantity.

2/ I press enter.

3/ Quantity field display value 500.

4/ I now try to delete the number 500 from the field add to quantity. Then the number 1 appears in this field and is added to the total quantity field.

So It seems impossible to remove the value entered in add to quantity or remove to quantity, which means then every addition or subtraction is false.

I hope now it is more clear :

Thanks

Link to comment
Share on other sites

Can you post a quick simple file for us to view what you mean? Zip it and it can be attached at the bottom of your post where it says in blue 'Manage Files'.

I don't understand why a 1 would pop into the Add field when you delete the 500. Don't worry, we'll figure this out together!

LaRetta

Link to comment
Share on other sites

each field sets the variable $qty to it self plus or minus the Quantity then zeros it self out

the variable is then set into the Quantity field because of the let statement - any referenced field used in the calculation will trigger the field to be updated.

Link to comment
Share on other sites

This topic is 5575 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.