ExecuteSQL. Not sure if you need it as a script or an un stored calc.
Set Variable $e =
ExecuteSQL ("SELECT DISTINCT (equip) FROM...
this will make a list of unified values.
Loop through the list using get value with
ValueCount (ExecuteSQL ("SELECT * FROM Table WHERE equip = ?"; ""; ""; value)
Store the list to a global variable and use on layout.
I'm looking for an unstored calculated field and\or statistics function to have a live results but if it's not possible i will try your script and I will execute it as needed.
I suggest that you move this data from a single field to a related table of records with one tecord to each listed value. That makes counting these values and other report tasks much simpler.
With preferring phil's suggestion (and not looking into your file), here is a custom function
You can use "List of" summary field as 1st parameter.
You would want another cf for sorting result.
My equip data are already in an other table with a relation. I will take a look at your cf. if it's not what I need, I'll be more specific with my problem.. thanks...
My equip data are already in an other table with a relation
Then count the data there rather than in your list fields. It's much simpler and no custom function needed.
I'm able to count my equipments in the other table but it's not working properly because the context is wrong. i need to count only related records from the other table not all the record. I'm sure it's simple but i'm missing something..
Not sure if this can help...
TblC is related to TblB related to TblA: i need to Count table C items individually for each record and show result in table A
Table A linked (Result i’m looking for)
record A1 B1, B3 2X (C1)
record A2 B2, B3, B4 1X (C1)
Table B Checkbox field containing table C Items
record B1 C1, C3
record B2 C2
record B3 C1, C4
It looks like this custom function is what i need assuming that i'm able to populate correctly a multivaluated field with the correct data. Working on it..
ExecuteSQL. Can be used to produce these counts from all records in table c that link via table b to a specific record in table a.
You could also use the following method:
Use go to related records to produce a found set of related records in table c on a layout based on table a. You can use summary fields, a sub summary part and record sorting to list each value once with a count of the number of records with that value. You could open a window as part of this script so that clicking a button on table a pops up a window with this data.
Ok so Bigtom and you are suggesting ExecuteSQL in a script with a popup containing the informations or a global variable that i can use anywhere at the end of the script...
It's not exactly like a calculated or statistic field but it looks like it's gonna be simpler for me. And there is not a lot of records to count so the script is gonna be fast.
Not exactly what i was looking for but it worked well... Thanks
Still have to understand the behavior of statistic field in a portal... too be continued..