
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Group By and Count Question in a Load Statement
In a Load Statement will this work:
A:
Load
AcctNum,
WOID
WOYear,
WOMonth,
Purpose,
Priority,
Craft,
Cost,
Hours
From
C:\QVD\Wotable.qvd;
B:
Load
AcctNum,
Count(WOID) as WOCount,
WOYear,
WOMonth,
Craft,
Purpose
Resident Table 1
Group By AcctNum, WOYear, WOMonth, Craft, Purpose;
Drop Table A
If that is fine I have two questions I need answered. First is it good to have the string of fields in the Group By Statement? Is it going to cause a Load issue? Does the order of the Group By Statement matter? Second is it good to have the Count(WOID) as WOCount as part of the Load statement or better to make it part of the expression on a chart? I want the Load statement to perform as much of the heavy lifting of calculation as it can. With Table A above I am reading in around 80 million rows of data so it is taking time for it to load in memory before I perform the actions in Table B. If there are any suggestions that would be awesome.
David
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David,
The script is correct. Multiple fields in "group by" is normal, and the order does not matter. It is better to count in the script especially with that number of records. You'll reduce the record count by using this aggregation in the script, hence smaller app size and better front end performance.
Regards,
Michael

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
David,
The script is correct. Multiple fields in "group by" is normal, and the order does not matter. It is better to count in the script especially with that number of records. You'll reduce the record count by using this aggregation in the script, hence smaller app size and better front end performance.
Regards,
Michael
