Count number of fields containing zero
In a table, I have 14 fields (this week, this week - 1, this week -2, this week -3, and so on, until I have the total miles in a field from 13 weeks ago), each containing the total paid miles for that week. Some weeks have zero miles. I need a formula to count the number of fields with zero miles over the past x weeks.
This week = 3527
This week - 1 = 1242
This week - 2 = 0
This week - 3 = 2934
This week - 4 = 7100
This week - 5 = 4324
This week - 6 = 3994
This week - 7 = 3631
This week - 8 = 986
This week - 9 = 0
This week - 10 = 3074
This week - 11 = 6647
This week - 12 = 2922
This week - 13 = 5814
ultimately, I would like to calculate the average miles over the last x weeks, excluding the weeks with zero miles in the average.
5 replies
-
Hi Chris
Whenever you have fields like this, it's a sign that the set-up is incorrect. Your multiple fields should be records in a sub-table. Once re-configured tasks like the one you are asking for become so much easier.
Do you have one record per quarter? How many records do you have?
Regards John
-
Chris Thomasson said:
However, I would also like to see the avg of x weeks, excluding the weeks that I was on Hometime.How is Hometime tracked in your DB? Is it in the Load table or the Milage table? You can filter out Hometime records from you searches by however you track Hometime.
-
Chris Thomasson said:
I just know that I must have been on Hometime, if the following pay period has zero miles.In a way you are tracking Hometime. You can filter out pay periods with miles != 0 (miles doesn't equal zero).
Content aside
- Status Answered
- 2 yrs agoLast active
- 5Replies
- 114Views
-
3
Following