Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Tags (2)
1 Solution

Accepted Solutions
mov
Not applicable

Re: Group By and Count Question in a Load Statement

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

1 Reply
mov
Not applicable

Re: Group By and Count Question in a Load Statement

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