Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

markgraham123
Contributor II

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;

Tags (2)
1 Solution

Accepted Solutions

Re: Count and Sum in Script execution

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;

19 Replies
Highlighted
cspencer3
Contributor II

Re: Count and Sum in Script execution

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
Contributor II

Re: Count and Sum in Script execution

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

Re: Count and Sum in Script execution

Could you post small sample of your data?

markgraham123
Contributor II

Re: Count and Sum in Script execution

Hi,

Please find the attachment.

sunindia‌ Can u too have a look at this!

Re: Count and Sum in Script execution

I'm using PE.

Attached csv or xls

markgraham123
Contributor II

Re: Count and Sum in Script execution

Hi,

PFA

markgraham123
Contributor II

Re: Count and Sum in Script execution

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;

Re: Count and Sum in Script execution

Really?

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

markgraham123
Contributor II

Re: Count and Sum in Script execution

I created a sample data sir.

Community Browser