Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How a count number of visitor per week and month?

Featured Replies

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.

chart-dashboard.thumb.png.9b3818345d543e0e0817187c7ac7ab4b.png

Script (Check-in ,Check-out and total)

chart.png.e9bda1c08b8f017a6ea6a785ba71ff3e.png

 

Edited by Msaeed

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))

 

  • Author

thank you for share your support. I will try and update you :) 

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 by comment

  • 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 by Msaeed

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. 

 

  • 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 by Msaeed
update

3 hours ago, Msaeed said:

will be more clear.

Nope.

  • 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.

 

 

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

  • 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 ...

1 hour ago, Msaeed said:

Thank you ...

Note that you can get the same result without performing a find:

 

ThisWeek+SQL.fmp12

  • Author

I appreciate all your support :) 

  • Author

In case ,I would like to showing the name of visitor current still check-in in dashboard. (or open new topic)

chart-dashboard.thumb.png.9b3818345d543e0e0817187c7ac7ab4b.png.f638106d4e8c62a69632a2430ceac6a6.png

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. 

 

  • 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.

1431601839_visitorlistindashboard.thumb.png.056cec2eb6d27e261c42f15df151ceee.png

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.

 

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.