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: 
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
MK_QSL
MVP
MVP

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
Author

Hi Manish,

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

CountError.PNG.png

MK_QSL
MVP
MVP

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

ashfaq_haseeb
Champion III
Champion III

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
Author

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

Not applicable
Author

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