Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Calculated Fields problem (iOS)
- This topic has 5 replies, 2 voices, and was last updated 10 years ago by Cliff Tarrance.
-
AuthorPosts
-
October 29, 2014 at 9:54 PM #11494
Cliff TarranceParticipantI am writing regarding problems with calculated fields in TapForms for iOS. I had written previously about this, and you had made changes I requested, but the behavior has reverted in recent versions, and is probably even a bit flakier than it once was.
To illustrate, I have a form where I record typical daily events in the care of my (originally infant) now toddler daughter. It’s meant to be a quick way to record things as they happen so I can later know how much she’s slept, when she last pooped (sorry!) and so forth.
For some of these events (the sleep events), I want to know the durations. For everything else, I don’t care.
So, long story short, I have two date/time fields: [Event start] and [Event end]. And I have a calculated field, [Duration], which is [Event end] – [Event start]. For every kind of event, I record the [Event start]. For the sleep events, I also record [Event end].
I expect that records with no value in [Event end] should show nothing in [Duration], but instead they show things like “-392947 hrs, 39 mins”.
In the record list view, I include the [Duration] field, but if a given record has no duration value (or should have no value), I would expect [Duration] to be omitted from the display. That’s how other types of fields are handled in the list view, but all the records show their [Duration] values.
Finally, the actual calculations don’t always work upon first entering the value in [Event end]. Sometimes I have to go back and re-save [Event start] for the calculation to execute.
I’m attaching screenshots, so hopefully all of this will be clear.
Attachments:
You must be logged in to view attached files.October 29, 2014 at 11:20 PM #11506
BrendanKeymasterHello Cliff,
I’ll take a look at these. The issue is that when there’s no date value specified the date used is January 1, 1970, which is obviously in the past, so that’s why you get the negative value. I did change the math parser code recently to use one which has more features, including the ability to concatenate text together, return an absolute date, or perform some functions.
Thanks,
Brendan
October 30, 2014 at 6:33 AM #11508
Cliff TarranceParticipantHi Brendan,
Is there no such thing as a null value?
November 12, 2014 at 7:51 AM #11719
Cliff TarranceParticipantHi Brendan,
I see you fixed this. Thanks!One slight problem, which I don’t know if you can help. When I launched the app after it was updated, I didn’t realize it was working…. it appeared to be hung and I forced it to quit. Now I realize it was updating old records, so many of the old records did not get the update to the duration calc. Is there any way to run that process again manually? Thanks.
November 12, 2014 at 11:01 AM #11720
BrendanKeymasterHi Cliff,
Make a small change to your calculation field formula. even adding just a space will do it.
November 13, 2014 at 11:45 AM #11728
Cliff TarranceParticipantah, great! thanks, Brendan.
-
AuthorPosts
You must be logged in to reply to this topic.