Cell value based on numeric increments

I have built an app that records vehicle maintanance for our fleet. mileage is put in with every gas/repair expense recorded. I’ve been trying to figure out two things…
First… What expression/action can I use if I wanted it to let me know when its time to change oil in 7500 mile increments? Every 7500 miles I would like it to change the status of another column so I know its time…

Second… How can I subtract the current mileage that is being put in from the previous mileage put in from the last automobile expense so I can calculate the miles driven?

Thanks in advance for the great job this community does… I pretty much live on this place anytime i have questions…

Chris

0 2 406
2 REPLIES 2

Hi,

increments like that benefit from the use of Modulo, in appsheet that’s the MOD() function. Here’s an example app:

https://www.appsheet.com/samples/Built-from-your-app-spec-?appGuidString=cd50017a-a5f4-407b-87c2-7e0...

I admit that I built it perhaps in a rush, so there could be errors in there - or maybe there is a better math calc to achieve it. But there’s a “warning” virtual column that says “when we get to 5% or less of the increment, throw warning, else throw OK”. Of course, AppSheet can’t force your audience to change their oil…

For your second question, the “mileage” data in this app has an example calc that does this. Again, just one possible idea.

I used the “Create from an Idea” data source (aka AppSheet “spec”) for this app, btw.

Your Mileage May Vary with this example… pun intended. Maybe some other folks here could “tune up” this app.

Hope thid helps!

Hey Chris,

So… This is my third-day using AppSheets, but I did find out something tonight that would work for your second question.

So in your Columns for your tracker, in the App Formula for your daily miles driven, put in something like this… INPUT("Current Milage", [milage]) - MAX([milage])

Obviously, you would use your columns names instead of my placeholders here.

Now because I’m so new to this, I’m not sure how the MAX() function works in AppSheets and I just assume that works like any spreadsheet… bringing you the largest number from that column, which then would be subtracted from the new milage you enter in your milage field on your form.

You should actually be able to see the numbers change as you enter the current milage…

I also changed the Editable? to false so that no one can change the number with in the form.

Top Labels in this Space