Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count of fields

Hi guys,

I have the following table:

Customer number,

Account number

Balance

I'm looking to put together a table which shows the number of accounts people hold. For example

Accounts held -- number of customers

1 -- 5

2 -- 1

3 -- 0

4 -- 8

Can anyone think of a way i can do this?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

In the script, something like:

Input:

Load

     [Customer number],

     [Account number],

     Balance

From <>;

Left Join

Load

          [Account Number],

          Count([Customer Number]) as NoOfCustomer

Resident Input Group By [Account Number];                       // Edit - Group by

View solution in original post

4 Replies
Not applicable
Author

Try This:

Script:

LOAD  * INLINE [
    CustomerID, BankAccount
    5, B1
    5, B2
    6, B3
    6, B4
    6, B5
    7, B6
    7, B7
    8, B8
    9, B9
    9, B10 
];

Create a Chart with one calculated Dimension:

aggr(count(BankAccount), CustomerID)

And Expression:

count(Distinct  CustomerID)

I think thats what you need

Regards,

Angel

tresesco
MVP
MVP

In the script, something like:

Input:

Load

     [Customer number],

     [Account number],

     Balance

From <>;

Left Join

Load

          [Account Number],

          Count([Customer Number]) as NoOfCustomer

Resident Input Group By [Account Number];                       // Edit - Group by

anbu1984
Master III
Master III

Initial:

LOAD  * INLINE [

    CustomerID, BankAccount

    5, B1

    5, B2

    6, B3

    6, B4

    6, B5

    7, B6

    7, B7

    8, B8

    9, B9

    9, B10

];

Final:

Load AccountsHeld,Count(AccountsHeld) as CustCnt Group by AccountsHeld;

Load Count(BankAccount) As AccountsHeld Resident Initial Group by CustomerID;

Anonymous
Not applicable
Author

That's the ticket. Thanks very much