Jump to content

How a count number of visitor per week and month?


This topic is 1315 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

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
Posted

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

 

  • Thanks 1
Posted

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

Posted (edited)

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
  • Plus1 1
Posted (edited)

 

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

 

Posted (edited)
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
Posted

 

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.

 

 

Posted

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

  • Like 1
Posted
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 ...

Posted

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

Posted
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

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

This topic is 1315 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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