Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

Count and Sum in Script execution

Hi,

Can someone help me in getting the count() function executed

Load

Place, Building, Location, Units, Bridge, Barcode, Units, Bay,  Position, Level, Position&Level as PL, Bay&Location as BL

from table1;

I wanna get the Count(Barcode) by Place

                        Count(Barcode) by BL

                         Count(If(Units>0, Barcode) by Place

                         Count(If(Units>0, Barcode) by BL

                        Sum(Units) by Barcode;

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Yes, your code will work, Instead the below code will also give the same result.

Left Join(Table1)

LOAD Warehouse,

  LBCD,

  Count(Distinct(LBCD)) as tt,

  Sum(Units) as TOtalUnits Resident Table1 Group By Warehouse,LBCD;

View solution in original post

19 Replies
cspencer3
Creator II
Creator II

Why does it need to be done in the load script and not in the App itself? Just to get a better understanding of what you would like to accomplish.

markgraham123
Specialist
Specialist
Author

There millions of rows of data which is slowing down the app when its calcualted in front end.

robert_mika
Master III
Master III

Could you post small sample of your data?

markgraham123
Specialist
Specialist
Author

Hi,

Please find the attachment.

sunindia‌ Can u too have a look at this!

robert_mika
Master III
Master III

I'm using PE.

Attached csv or xls

markgraham123
Specialist
Specialist
Author

Hi,

PFA

markgraham123
Specialist
Specialist
Author

Was trying this Sir.

Table1:

LOAD Warehouse,

     LBCD,

     Zone,

     Units

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

Left Join(Table1)

Load Count(LBCD) as Total, Count(If(Units>0, LBCD)) as Filled Resident Table1 Group by Warehouse;

Left Join(Table1)

Load Sum(Units) as TOtalUnits Resident Table1 Group by LBCD;

robert_mika
Master III
Master III

Really?

This is the same data set as per your first post....?

markgraham123
Specialist
Specialist
Author

I created a sample data sir.