Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Count Function while Loading Excel

LOAD No,

    
Customerid,
   
Count(Customerid) as Count,

From XXXXx

I would like to Count Number of customer while lodaing using scrip. Please help me.

6 Replies

Re: Count Function while Loading Excel

Try as below

LOAD

     No,
    
Customerid,
   
Count(Customerid) as Count,

From XXXXx

Group By No, Customerid;


Or


Load

     Customerid,

     Count(Customerid) as Count

From xxxx

Group By Customerid;

Not applicable

Re: Count Function while Loading Excel

Hi Manish,

I tried the above code but getting the following error. I am using trail version is that the case?

CountError.PNG.png

Re: Count Function while Loading Excel

Try

Load  

     No,

     Customerid,

     Count(Customerid) as Count

     all otherfield....

From ....

Group By No, Customerid, all other fields also except Count(Customerid);

You need to add all fields in Group By

Re: Re: Count Function while Loading Excel

Hi try Below

Temp:

Load   

     No,

     Customerid,

      all otherfield....

From ....

Main:

Load  

     No,

     Customerid,

     Count(Customerid) as Count

     all otherfield....

resident Temp

Group By No, Customerid, all other fields also except Count(Customerid);

Drop table Temp;

Regards

ASHFAQ

Not applicable

Re: Count Function while Loading Excel

Load

     No,

     CostumerID,

     count(CustomerID) as Count

from ...

group by No, CostumerID

just in case you have some other fields you want to load you also have to put it in the group by statement.

regards,

MT

Highlighted
Not applicable

Re: Count Function while Loading Excel

Hi Thanks

I am trying to write code to create a list box with Product Name and count of number of Customerids like the graph below. The purpose is to create custom list boxes using the Script and visualize them. Can I write SQL scripts in Qlikview.??????

CountF.PNG.pngHi

Community Browser