Forum Discussion
PaulPeterson1
Qrew Assistant Captain
Make your "Count" field a Formula - Numeric field, then you can try something like this:
var text tableID = tid;
var text query = "{'fid1'.EX." & [Name] & "}AND{'fid2'.EX." & [Week] & "}AND{'fid3'.EX." & [Color] & "}AND{'3'.LTE." & [Record ID#] & "}";
Size(GetRecords($query, $tableID))
Where tid is the table ID where the source data is housed, fid1 is the field ID for the Name, fid2 is the field ID for Week and fid3 is the field ID for Color.
This should at least get you into the ballpark.
Then you would need a second query on the count field to return the max.
------------------------------
Paul Peterson
------------------------------
var text tableID = tid;
var text query = "{'fid1'.EX." & [Name] & "}AND{'fid2'.EX." & [Week] & "}AND{'fid3'.EX." & [Color] & "}AND{'3'.LTE." & [Record ID#] & "}";
Size(GetRecords($query, $tableID))
Where tid is the table ID where the source data is housed, fid1 is the field ID for the Name, fid2 is the field ID for Week and fid3 is the field ID for Color.
This should at least get you into the ballpark.
Then you would need a second query on the count field to return the max.
------------------------------
Paul Peterson
------------------------------
GunshamLakhiani
3 years agoQrew Cadet
Hi Paul,
Thank you for the query. Now it shows me the count of same rows as 1, 2 and so on which is much better than what it was showing with my query as 2 and 2 on both the rows.
I would now like to have the higher count rows added to another table. Would that be possible thru a pipeline where it can check the Max Record id and push that record into the new table?
Not sure how to go about it.
Regards
Gunsham
------------------------------
Gunsham Lakhiani
------------------------------
Thank you for the query. Now it shows me the count of same rows as 1, 2 and so on which is much better than what it was showing with my query as 2 and 2 on both the rows.
I would now like to have the higher count rows added to another table. Would that be possible thru a pipeline where it can check the Max Record id and push that record into the new table?
Not sure how to go about it.
Regards
Gunsham
------------------------------
Gunsham Lakhiani
------------------------------
- PaulPeterson13 years agoQrew Assistant CaptainYou can try something like this in tasks table:
var text tableID = tid;
var text query = "{'fid1'.EX." & [Name] & "}AND{'fid2'.EX." & [Week] & "}AND{'fid3'.EX." & [Color] & "}AND{'3'.LTE." & [Record ID#] & "}";
Max(GetFieldValues(GetRecords($query, $tableID), fidCount);)
Again, not tested, but should be pretty close to what you'll need.
------------------------------
Paul Peterson
------------------------------