trip_pallet_count = DropColumns(
AddColumns(
GroupBy(
pallets,
"trip_id_display", // Group by this field
"grouped_data" // Name for the grouped data table
),
"count_p", // New column for the count of pallets
CountRows(grouped_data) // Count rows in the grouped data table
),
"grouped_data" // Remove the grouped data column if not needed
);
your code had following issues:
The GroupBy function doesn't automatically create a collection of rows in a usable format for the CountRows function.
The CountRows function is attempting to count rows in the id field, which is not the correct way to reference a grouped collection.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.