June 23, 20214 yr Hi all, I wonder how can add an extra touch in the visitor system in terms of a count number of visitor per week and month through dashboard. Script (Check-in ,Check-out and total) Edited June 24, 20214 yr by Msaeed
June 24, 20214 yr A lot of times in my data set I will create calculated fields from desired component of a date: YYYY: Year ( System::Date ) MM: SerialIncrement ( "00" ; Month ( System::Date ) ) WW: SerialIncrement ( "00" ; WeekofYear ( System::Date) ) You can use these together such as find 2021 & 06 for this month or 2021 & 26 for this week. Note: for month values you could easily derive the value: "06/*/2021" or in your find request instead of Get(currentDate). ie Month ( Get(CurrentDate) ) & "/*/" & Year ( Get(CurrentDate))
June 24, 20214 yr To find records in the past 7 days, you could do: Enter Find Mode [] Set Field [ YourTable::Datefield ; ">" & Get(CurrentDate) - 7 ] Perform Find [] To find records in the current week (weeks starting on Sunday), you could do: Enter Find Mode [] Set Field [ YourTable::Datefield ; ">" & Get(CurrentDate) - DayOfWeek ( Get(CurrentDate) ) ] Perform Find [] To find records in the current month, I would suggest you do: Enter Find Mode [] Set Field [ YourTable::Datefield ; ">" & Get(CurrentDate) - Day ( Get(CurrentDate) ) ] Perform Find [] Once you have the found set you want, you can set a global field or variable to the value of Get(FoundCount) and use it in your dashboard display. 6 hours ago, Ocean West said: for month values you could easily derive the value: "06/*/2021" or in your find request But this assumes the date format in use is M/D/Y? Edited June 24, 20214 yr by comment
June 24, 20214 yr Author Thanks a lot for your support and help Past 7 days Enter Find Mode [] Set Field [ Visitors System::Date ; Get(CurrentDate) - 7 & ".." & Get(CurrentDate) ] Perform Find [] Set variable [$$week: Value:Get(FoundCount)] Enter Find Mode [] Set Field [ Visitors System::Date ; ">" & Get(CurrentDate) - DayOfWeek ( Get(CurrentDate) ) ] Perform Find [] Set variable [$$currentweek: Value:Get(FoundCount)] in case add a new record on Sunday to Monday still the count found must be zero until insert new record. also this issue same current week. regarding Month the code working prefect. Edited June 24, 20214 yr by Msaeed
June 24, 20214 yr 3 minutes ago, Msaeed said: in case add a new record on Sunday to Monday still the count found must be zero until insert new record. also this issue same current week. I am afraid I do not understand what "this issue" is.
June 24, 20214 yr Just now, Ocean West said: you need three dots in your RANGE. "..." Two are enough (at least in this case). https://help.claris.com/en/pro-help/content/finding-ranges.html The ellipsis character also works - even though undocumented.
June 25, 20214 yr Author 17 hours ago, comment said: I am afraid I do not understand what "this issue" is. I will upload the simple file will be more clear. GMS-2021.fmp12 Edited June 25, 20214 yr by Msaeed update
June 25, 20214 yr Author On 6/24/2021 at 10:35 PM, comment said: To find records in the current week (weeks starting on Sunday), you could do: Enter Find Mode [] Set Field [ YourTable::Datefield ; ">" & Get(CurrentDate) - DayOfWeek ( Get(CurrentDate) ) ] Perform Find [] Ex. I will start on Sunday (4-July ) until Monday (12-july)to insert an add new record Su. 4 : 1 record Mo. 5: 1 record Tu. 6: 1 record We 7: 1 record Th 8: 1 record Fa 9: off Sa 10 : 1 record Su 11: 1 record Mo 12: 1 record The total records are 8 also shown in dashboard 8. as mentioned above your code, must start the new week on Sunday 11 will be 2 records according to my example, not 8 records showing in the dashboard.
June 25, 20214 yr Well, today is Friday, June 25, so if you run the Find Current Week script in the attached file today or tomorrow, you should find records whose date is Sunday June 20 or later. At least that's how it works for me. Note that we are assuming here that there are no records with future dates. ThisWeek.fmp12
June 25, 20214 yr I have used this custom function for years to generate ranges MagicDates ( "LastWeek" ) or MagicDates ( "ThisQuarter" ) https://www.briandunning.com/cf/748 ThisWeek.fmp12
June 26, 20214 yr Author 10 hours ago, Ocean West said: I have used this custom function for years to generate ranges MagicDates ( "LastWeek" ) or MagicDates ( "ThisQuarter" ) https://www.briandunning.com/cf/748 ThisWeek.fmp12 180 kB · 1 download Thank you... 14 hours ago, comment said: Well, today is Friday, June 25, so if you run the Find Current Week script in the attached file today or tomorrow, you should find records whose date is Sunday June 20 or later. At least that's how it works for me. Note that we are assuming here that there are no records with future dates. ThisWeek.fmp12 156 kB · 3 downloads Thank you ...
June 26, 20214 yr 1 hour ago, Msaeed said: Thank you ... Note that you can get the same result without performing a find: ThisWeek+SQL.fmp12
June 26, 20214 yr Author In case ,I would like to showing the name of visitor current still check-in in dashboard. (or open new topic)
June 27, 20214 yr 19 hours ago, Msaeed said: I would like to showing the name of visitor current still check-in in dashboard. I am afraid I couldn't understand this at all.
June 28, 20214 yr Author On 6/27/2021 at 8:07 AM, comment said: I am afraid I couldn't understand this at all. in fact, I would like create list who still check-in when press the circle (check-in).like below figure.
June 28, 20214 yr I don't know what "still check-in" means. If such list can be constructed by a find, then you could open a new card window and perform the find there.
June 28, 20214 yr Author 18 minutes ago, comment said: I don't know what "still check-in" means. If such list can be constructed by a find, then you could open a new card window and perform the find there. I meaning the visitor not check out from the system.
Create an account or sign in to comment