Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

View solution in original post

1 Reply
Anonymous
Not applicable
Author

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