Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I am trying to found out the number of times a customer has signed in the last 30 days. I have a table named “sign_in” and each customer has an ID number. Any help to point in the right direction would be appreciated.

Posted (edited)

I did some testing and found this to work pretty well.

In your "sign_in" table create a number calculation field like this:

Name: [color:gray]LastThirty

Formula: [color:gray]If ( [date_field] ≥ (Get ( CurrentDate ) - 30); 1; "" )

(In the storage options check "Do not store calculation results)

Now, back in your "customers" table create a relationship to the "sign_in" table like this:

[color:gray]customers::customerID = sign_in::customerID

(you'll of course need to make sure that when records are created in the "sign_in" table that they have a customerID value that matches a record in your "customers" table)

Now to get your count. In the "customers" table create a calculation field like this:

Name: [color:gray]Count

Formula: [color:gray]Count ( sign_in::LastThirty )

The count function will return the number of related records that contain a valid value in the "LastThirty" field. So, only those that are within the last thirty days. The small test I put together seemed to work well. Even when I manually changed the date/time on my computer, the correct count would appear after any kind of screen refresh (layout change, record load, etc) Let me know if that helps.

Edited by Guest

This topic is 5315 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.