Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ecabanas
Creator II
Creator II

Load sum group by

Hi,

I have a table like this:

   

created_atCustaccounttotal
04/01/2016 10:11C00000379,55
18/01/2016 11:00C000003103,42
08/02/2016 11:08C000003137,77
23/02/2016 15:36C000003133,43
01/03/2016 12:34C00000374,63
11/03/2016 12:07C00000364,46
11/03/2016 19:36C00000317,95

I want to sum the total per month and group by custaccount in load script.

for example:

C00003 jan-16: 182,97€

C00003 feb-16: 271,20€


Many thank's


Eduard

1 Solution

Accepted Solutions
sunny_talwar

May be you want it grouped by customer account and MonthYear:

Join([Customer_sales])

Load MonthYear,

  Custaccount,

  Sum(total) as Gasto

Resident [Customer_sales]

Group by MonthYear, Custaccount;


Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Try something like this:

Table:

LOAD created_at,

  MonthName(created_at) as MonthYear,

    Custaccount,

    total

FROM

test_file.xls

(biff, embedded labels, table is Sheet1$);

Join (Table)

LOAD MonthYear,

  Sum(total) as [Sum of Total]

Resident Table

Group By MonthYear;


Capture.PNG

ecabanas
Creator II
Creator II
Author

Hi Sunny

The totals did not sum correctly, see attached the project and the excel file

Many thank's

Eduard

sunny_talwar

May be you want it grouped by customer account and MonthYear:

Join([Customer_sales])

Load MonthYear,

  Custaccount,

  Sum(total) as Gasto

Resident [Customer_sales]

Group by MonthYear, Custaccount;


Capture.PNG

ecabanas
Creator II
Creator II
Author

Yessss perfect!!! many thank's again Sunny....i have another for you see next post 🙂

jagathi
Contributor
Contributor

How do we use Where clause for this case? 

Say we have loaded the input

get the sum of sales based on group by customer and month year

After this, I need to see the sales details which are more than 20,000 only 

Then how do I apply the Where clause sum(sales)>20,000 for this script