Date formula
I have my employer's time sheet built into Ninox and it works great except for February. I want to be able to hide the days that the month does not have (Day 31 normally). And this works except for February. I can hide Day 29 and Day 30 , but Day 31 shows up. I have a start day and end day, and have 3 conditions to hide the field, and it functions correctly except in February. Attaching pics. Type 31 is a choice field that has Regular day, sick day, vacation, etc. Override is if it is a weekend and we have been out for what ever reason I need it to show up because I hide weekends as well.
24 replies
-
So what field do you use to hide Day 29 and 30? Maybe lead with that field, then filter on days of the week.
Also, as an FYI, when you find your self creating fields that have a number at the end because you need want to store many iterations of the same data (i.e. Type 1 - 31 or Day 1 - 31), then you probably should create a child table that stores the data.
With a child table, that only has Day and Type instead of Day 1 and Type 1, you can quickly filter your table without complicated formulas that have to look at Day 1 - 31 or Type 1 - 31 or any other of the fields that has 31 iterations.
-
Hi
I agree with Fred. Having 31 copies of the same fields is going to be so hard to maintain. Create a child table with a single copy of the same set of fields and then create the records you need in a script. Everything becomes so much easier once you have done this. You can then create dashboards, summaries, reports etc very easily.
For example, if you wanted to add up hours for the month, you would currently need to have a formula
Hours01 + Hours02 + Hours03 + ... + Hours30 + Hours31With a child table this would become
sum(childTable.Hours)If you need some help to do this Fred or I are on-hand.
Regards John
-
said:
also i tried downloading the time tracking template. It just goes to my ninox page and does nothingIt sounds like you have the cloud version of Ninox. You don't see the Time Tracking DB in your workspace? That is what happened to me when I clicked on button.
-
I started re-creating your formula and this works
format('Start Date' + 30, "MM") = format('Start Date', "MM")But this doesn't
format('Start Date' + 30, "MM") = format('Start Date', "MM") and 'Formula 31a' = "Monday" or 'Formula 31a' = "Tuesday"I am almost certain that it's to do with the fact that you are mixing and's and or's and it will display if the day is a Tuesday.
Regards John
Content aside
- yesterdayLast active
- 24Replies
- 77Views
-
3
Following
