Hi All,
I have an expression setting the value of a percent column. When I test the expression it work perfectly. Currently it should be 100% done with a value of 1.00 and that is what the test result shows. Now when I view this data either in the form or in the database after it is saved for some reason it is 20%. It seems that my expression where I am using SELECT() functions work correctly during testing but are not working as expected outside of testing. Any idea why this would be? This is the first time I have had a test value that is different than the actual so I am not sure how to trouble shoot this one.
Database
Testing
Form View
Did you ever get a solution to this?
+1 expression testing showing the correct result but the app or data is wrong
AppScript must be buggy!?
I have an amount calculated based on a time duration (the Hourly Rate used here is $60, I'm also rounding to the nearest 15 minutes)...
IF( Round(Totalhours([Duration])*60+14)/15*15/60.0 > 0,
(Round(Totalhours([Duration])*60+14)/15*15/60.0)*DECIMAL([Client].[Hourly Rate]),
0
It works perfectly when testing:
However, rendered in the app it looks like this!? Huh?!
OK, so I thought maybe it had to do with using a spreadsheet as a source. I built the same with AppSheet DB and here's a side-by-side comparison after updating the record with the formula shown in my previous post.
I made this a TEXT field so I could see various values - factor and due - but results were the same if it was a PRICE field...
The above is the Test run on the expression/formula running from the AS DB version and what is showing in the preview pain (to the right). This result (same expressions used) had different values then what I am getting in the gsheet source app (see my 6.5 hours example above)!!
See below - as compared to my previous post...
What am I missing?! ๐ค
This is not a precision problem. I suspect values are not converting/calculating like you expect.
Please show all the bits and pieces.
Hi @WillowMobileSys thanks for the questions! See my post below, I'll consider this the solution for now.
I think I was over complicating matters, but yes, there certainly does seem like rounding gets funny when it comes to Time values and converting them!!
UPDATE:
In case you are interested, I've had a bit more time to respond. Your questions are in Blue \ @WillowMobileSys :
I have a Client and Tasks table used for my app.
(is there an easy way to capture table definitions for posting?)
Tasks is now changed to what I posted below. So likely not that helpful.
I am pretty sure that AppSheet has issues with TIME value conversions in general. This was another one I posted and must of the info of what I was doing can be gleamed from the test result capture - formula, headings show data types, etc. The test result is good - rendering bad.
I've since fixed this as well - see this post . None the less, I don't know why this didn't work - even if it was overkill. ๐
Oh my, I think too much like a programmer maybe, but if I simplify this formula to just this:
TOTALHOURS([Duration]) * [Client].[Hourly Rate]
..it works just fine! ๐
I didn't realise that TOTALHOURS() gives a decimal value - hence the factor I needed to calculate the amount.
I still don't understand why it doesn't render correctly in the above examples though.
@KGingeri wrote:
I still don't understand why it doesn't render correctly in the above examples though.
Where are you seeing the differences and how are they being built/derived/calculated?
@WillowMobileSys I don't have much more to share than what's in this thread. A basic summary is:
That's really all I have to share. I've abandon plans to display the duration in that form and just store and display it in decimal. Rendered in the app all works this way.
So my problem is solved.
User | Count |
---|---|
40 | |
32 | |
30 | |
16 | |
16 |