Hiโฆ
I have an app that records surgery details. Thereโs an Enum type column called [Surgery Status], that has 3 values - Done, Pending, Postponed.
If a particular patientโs surgery gets postponed, just tapping โPostponedโ in the [Surgery Status] column should record a value of 1 in a Number type column called [Postponed Times]. Now, once this postponed patient gets rescheduled for surgery, the person who maintains the app will change the [Surgery Status] to โPendingโ, and still that should keep the value 1 in the [Postponed Times] column which was previously recorded when the surgery got postponed (because the patient was postponed once). Now letโs say, this patientโs surgery gets postponed again for the second time also, and now the person who maintains the app changes the [Surgery Status] again to โPostponedโ. When that happens, I want that [Postponed Times] column to record the value 2, as now this patientโs surgery got postponed twice. I want this going on for as long as the patientโs surgery status changes from pending to done (letโs say if the surgery gets postponed 4 times, I want the [Postponed Times] column to record the value 4 automatically).
I wrote an expression to the [Postponed Times] Number type columnโs app formula
IF([Surgery Status]=โPostponedโ,[Postponed Times]+1,[Postponed Times]+0)
While it does work, only issue is, when ever the same patientโs data row is accessed via the edit button to change some other info of the patient, if the [Surgery Status] is kept at the โPostponedโ value for the patient, this adds a +1 value to the [Postponed Times] column again which I donโt want to happen. Is there a way to mitigate this issue and just maintain an authentic counter for the number of times the surgery gets postponed for the patient?
Thanks a lot
I would suggest using actions to modify the Surgery Status column, rather than allowing the user to set the columnโs value directly. With an action, you can both increment the counter and change the status (if appropriate) at one time with only a single tap by the user.
Thank you Steve. I had to resort to what you suggested. And it works for me. Thank you very much!
User | Count |
---|---|
43 | |
32 | |
25 | |
23 | |
14 |