Hi all - just started using AppSheet, and pulling my hair out about an problem:
I have create an invoice form that has a field called โInvoice VAT.โ This is set up as a Decimal, and should be calculated based on a VAT Rate (which is a percentage referenced from another table) and a Total Amount, which is a Number entered in the form by a userโฆ
My problem is that the โInvoice VATโ field will not show a Decimal. For instance, if the actual amount should be 2.50, the โInvoice VATโ field shows 3. If the actual amount is 0.35, the โInvoice VATโ field shows 1.
Just to double-check, I set the โInvoice VATโ field to equal whatever the user selects from the VAT Rate dropdown, but it still doesnโt show the decimal. If the User selected 21% from the VAT Rate drop-down, the โInvoice VATโ shows 1.00.
I really cannot figure out what is going on here.
For reference, for the โInvoice VATโ I have the following Type Details set up:
Numeric Digits: 2
Maximum Value: blank
Minimum Value: blank
Increase/decrease step: blank
Decimal digits: 2
Thanks in advance!
Solved! Go to Solution.
Ok so as I figured it was a stupid mistake. For the ENUM values, I typed in 21% thinking that since I set the field as a Percentage it would know that I meant 21%, or 0.21. However, it looks like it didnโt recognise 21% as a number at all.
I decided to see what happened if I just typed 21. I though since I set the field as percent may it would see 21 as 21% or 0.21, but I saw that it was interpreted as 2100%. So then I just typed 0.21 in the ENUM field and lo and behold it works.
So stupid mistake, although AppSheet could be clearer in how the Percentages should be entered.
I assume this is an Enum type column with base type percent?
Itโs actually a REF type, pointing at a table where I keep VAT rates.
And the column type of VAT rates is a decimal type?
is it coming from some-kind of calculation?
The VAT rate column type is a Percentage (in the original table where its stored). Itโs not calculated, its just typed in.
Click through for a likely fix:
Why wouldnโt Total Amount be a Decimal?
I played with this a little. See the results in the image below. Make sure your column capturing the result is Decimal.
It is ok if the user input value is of NUMBER type (the column SomeNumber in the image).
Below, the VAT fields both use the same calculation. One is set as a NUMBER type while the other is set as a DECIMAL type.
Thanks all for your help. Iโm still not getting the right answer, so I have decided to change things up a little to make things easier to troubleshoot.
First, User can now select โVAT Rateโ from ENUM. ENUM values are 21.00% and 0.00%, and are set to Percentage as data type.
โInvoice Amountโ is now a Decimal.
I am trying to calculate VAT Amount. Field is set as Decimal. My formula is [Invoice Amount]*[VAT Rate].
No matter what values I choose for VAT rate, or what amount I put in Invoice Amount, the VAT Amount shows 0.00.
I really have no idea whatโs going on here, this should be super simple.
Ok so as I figured it was a stupid mistake. For the ENUM values, I typed in 21% thinking that since I set the field as a Percentage it would know that I meant 21%, or 0.21. However, it looks like it didnโt recognise 21% as a number at all.
I decided to see what happened if I just typed 21. I though since I set the field as percent may it would see 21 as 21% or 0.21, but I saw that it was interpreted as 2100%. So then I just typed 0.21 in the ENUM field and lo and behold it works.
So stupid mistake, although AppSheet could be clearer in how the Percentages should be entered.
I thought you were at this point when asked you the first question about base type percent. Actually this is not a stupid mistake, but you need to take care for the next issue for doing math with decimal as guided by Steve in his post.
You may close this post with your answer as acceptable answer and just post another question whenever you like.
User | Count |
---|---|
36 | |
33 | |
27 | |
23 | |
18 |