Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need Script to Count Master Customers

I have a table with the unique key of Customer Number and a field that has the Master Customer number. The master customer represents the customer number that they are associated with. Say for example a person owns 10 stores. Then the table will have 10 unique Customer Numbers (ie CustromerNumber1, CustomerNumber2, CustomerNumber3 . . . CustomerNumber10) and for each of the 10 customers they will have the same Master Customer number (ie CustomerNumber1). If an owner has only one store then the Customer Number and the Master Customer number will be the same.

I need to load this table with the Master Customer Number and the total count of the master customers. So in the above example I want to:

MasterCustomerNumber  - Total Count

CustomerNumber1          -  10

CustomerNumber 11 would be the next customer to list and may have a 1 for the count ir maybe a 5 if the owner owns 5 stores.

How do I do this?

Thanks,

Stephen

2 Replies
Not applicable
Author

As I see it you could add a field dummy with ' 1 ' as value and then do a group by Master Customer and sum the dummy field.

Hope it helps!

Not applicable
Author

Thanks Carlos,

That put me on the right path. Problem solved!

Stephen