Hey @Nikiska. I'm pretty sure this can only be accomplished with some scripting. I can help you with the script, it shouldn't be too bad. Would you mind sharing some test data with me so I can write and test the script for you?
Your up/down column needs an IF() statement that checks to see if there’s anything in Previous weight before doing the calculation that results in up/down.
IF(
AND(
{Previous weight}, {Previous weight}-{Current weight}<0
),
“up”,
IF(
AND(
Previous weight}, {Previous weight}-{Current weight}>0
),
“down”,
“”
)
As far as eliminating copy/paste, I would add a checkbox field called Enter New Weight that triggers an Update Record automation that copies the data from the current weight and date to the previous weight and date, clears the current weight and date and resets the checkmark to unchecked. But but but but if you need to keep a record of previous weights this will not work.
Hey @Nikiska!
Just letting you know that I’ve seen this! I’m going to take some time to play around with this and put together some solutions for you.
Oops I haven’t had enough coffee. The formula to just have the weight difference and emoji is
IF({Previous weight}, {Previous weight}-{Current weight})& IF({Previous weight}-{Current weight}>0, “ ⬇️”, IF({Previous weight}-{Current weight}<0, “ ⬆️”, “ 🟰”)
Hey @Nikiska!
Just letting you know that I’ve seen this! I’m going to take some time to play around with this and put together some solutions for you.
Thank you 🙂
Hey @Nikiska. I'm pretty sure this can only be accomplished with some scripting. I can help you with the script, it shouldn't be too bad. Would you mind sharing some test data with me so I can write and test the script for you?
Sure - I have screenshot the actual airtable table in my question, but attached is a couple of rows in an excel sheet (no formulas, just figures)
Your up/down column needs an IF() statement that checks to see if there’s anything in Previous weight before doing the calculation that results in up/down.
IF(
AND(
{Previous weight}, {Previous weight}-{Current weight}<0
),
“up”,
IF(
AND(
Previous weight}, {Previous weight}-{Current weight}>0
),
“down”,
“”
)
As far as eliminating copy/paste, I would add a checkbox field called Enter New Weight that triggers an Update Record automation that copies the data from the current weight and date to the previous weight and date, clears the current weight and date and resets the checkmark to unchecked. But but but but if you need to keep a record of previous weights this will not work.
Thank you, those emoji's work great, I now need to add the actual weight difference into your formula somehow!! 😁 So the column will read -0.75kg ⬇️ ; or 0.9kg ⬆️ ; etc etc!
This is what I am currently using to get the difference in weight to 2 decimal places:
ROUNDUP(FLOOR(SUM({Current Weight (kg)}-{Previous weight}),0.001),2)& "kg"
@Nikiska I made a base + script for you. I believe this will do exactly what you're asking for.
Watch the loom video below for a 60 sec demo
https://www.loom.com/share/9f17f57c72e14ad5be67d04a19e83382?sid=402c3700-310b-4840-a019-025149e885e1
Copy this base to get the script
https://airtable.com/appUyycRiK3Eum1z3/shrALRM0ndztSAHCm
Thank you, those emoji's work great, I now need to add the actual weight difference into your formula somehow!! 😁 So the column will read -0.75kg ⬇️ ; or 0.9kg ⬆️ ; etc etc!
This is what I am currently using to get the difference in weight to 2 decimal places:
ROUNDUP(FLOOR(SUM({Current Weight (kg)}-{Previous weight}),0.001),2)& "kg"
I’m confused. You have weights entered to 1 decimal point, but you want the weight differences to be to 2 decimal points? I think I’m missing something…
I’m confused. You have weights entered to 1 decimal point, but you want the weight differences to be to 2 decimal points? I think I’m missing something…
Hiya - oops - didn't see that - I'm actually not that bothered to be honest. Most vet scales will give it to one decimal place so lets stick with that! Soz
Hiya - oops - didn't see that - I'm actually not that bothered to be honest. Most vet scales will give it to one decimal place so lets stick with that! Soz
Then this should work:
IF({Previous weight}, {Current weight}-{Previous weight})& IF({Current weight}-{Previous weight}>0, “kg ⬆️”, IF({Current weight}-{Previous weight}<0, “kg ⬇️”, “kg 🟰”)
As far as the automation part goes, I would need to know more about how your base is actually structured to help you do that without a script. @Jake_Wilson already provided a script for you if that’s the direction you want to go.
Good luck!