I am recording tests and need to be able to start back at 1 on each day and then automatically count for that day only. Meaning if I ran 10 tests today I need my form to auto number each test I enter for today, and then tomorrow start back at 1. Could someone help me?
I think you could do something by setting an initial value expression on your test number column.
Basically, if the previous recordโs creation date is equal to todayโs date, the initial value of the test number column should be the last recordโs test number +1. But if the previous recordโs creation date is less than todayโs date than the initial value of the test number column should be 1.
Maybe something like:
IF([_THISROW-1].[CreationDate] = TODAY(),
[_THISROW-1].[TestNumber]+1,
1)
Youโd have to add the CreationDate column though and make sure it stores the correct date value.
Edit: Nvm, [_THISROW-1] doesnโt work the way I thought it would. You could try comparing the latest date in the table like this:
IF(MAXROW(โTestโ, โDateโ) = TODAY(),
[_THISROW].[TestNumber]+1,
1)
This way youโd be comparing to the test with the largest Date value instead of the previous. It would be hard to add tests on days other than the current day.
Alright, final edit cause I think this works:
IF(
MAX(Test[Date]) = TODAY(),
MAX(SELECT(Test[TestNumber], ([Date]=TODAY())))+1,
1)
User | Count |
---|---|
60 | |
25 | |
13 | |
11 | |
6 |