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.

Feeding data...

Featured Replies

Hi!

 

I've got a list with among other data a number. I want to save in a field the count of those numbers, for instance on today's run we've got two counts of 104, seven of 201, 13 of 220, and so on (somewhere like ten different values every day).

 

I has to be saved every night for a history.

 

It will run as nightly scripts on a FM Server 13.

 

What is the best solution for this? Sort Data, count the occurrences and feed a repeated field is the one I have in mind. Is this old fashioned or the way to go?

 

Thank you for your comments on this.

What exactly do you mean by "a list"?

  • Author

there is the value which defines the "title" and the hits for that title, for instance hit for 104, followed by hit for 220, followed by hit for 104, hit for 201, and so on...

I am sorry, but you're not being clear. Is the given data organized in a table - as records and fields? If yes, what are the fields in this table? And how will you find the data that needs to be summarized every night? Is there a Date field?

  • Author

sorry for not being clear...

 

yes, a table, with title (the number), a timestamp & some other info I discard for that need.

 

In fact, all I need is the count of numbers in the found set.

Okay, then. First, I would suggest that your target table have the following fields:

• Date

• Value

• Frequency

I presume the purpose of this table is to allow some statistical overviews to be produced - which would make repeating fields a very poor choice.

 

Now, as you have already surmised, your script needs to find the relevant source data, sort it by value (Title?) and then create a record in the target table for each sub-summary value. This is best achieved using a method called "Fast Summaries" (look it up).

  • Author

thank you - I'm not sure it's the best way to go as it should create a history - I will give it a try

I'm not sure it's the best way to go as it should create a history

 

There are two questions here:

 

1. What is history (in this case)?

 

2. What's the best way to keep it?

 

 

If we accept your description in the original post:

 

the count of those numbers, for instance on today's run we've got two counts of 104, seven of 201, 13 of 220, and so on

 

as the answer to the first question, then there can be little doubt that the three fields described in my post are the answer to the second one.

 

 

--

Though of course we are speaking in generalities, since you haven't told us anything about the meaning of this data and the purpose of keeping it.

Edited by comment

  • Author

There are two questions here:

 

1. What is history (in this case)?

 

2. What's the best way to keep it?

 

 

If we accept your description in the original post:

 

 

as the answer to the first question, then there can be little doubt that the three fields described in my post are the answer to the second one.

 

 

--

Though of course we are speaking in generalities, since you haven't told us anything about the meaning of this data and the purpose of keeping it.

 

Every week (title) there are occurrences of case numbers (hit). Those records might be deleted with the time, and we need to keep record of the situation at a given (past) date.

 

That's why I plan to create a new table. Is my description clear, or should I be more concrete?

 

Thank you for your advices.

Is my description clear, or should I be more concrete?

 

I am not sure: you didn't say anything about "every week" until now. The way I understand your description now, you have a table recording every single instance of [something] and you want to keep - in another table - the history of summary values only for each day (or week?), for example:

 

Log:

2014-08-05    201

2014-08-05    201

2014-08-05    104

2014-08-05    220

2014-08-05    201

2014-08-05    220

2014-08-05    104

2014-08-05    201

2014-08-06    220

2014-08-06    104

2014-08-06    201

2014-08-06    201

2014-08-06    201

History:

2014-08-05    201   3

2014-08-05    104   1

2014-08-05    220   2

2014-08-06    104   2

2014-08-06    201   4

2014-08-06    220   1

 

That's a fairly common requirement, and implementing it is merely a matter of summarizing the daily log values and creating a history record for each sub-summary.

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.