Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anybody help in this?
I want this output :
Month | Top Customer | Sales by Customer | % Contribution |
---|---|---|---|
Jan 2016 | Arun | 10000 | 12% |
Feb 2016 | Sam | 15000 | 16% |
Mar 2016 | Arun | 12000 | 15% |
Apr 2016 | Vinoth | 9000 | 10% |
Hello Ram,
Trust that you are doing great!
Please refer the sample application attached herewith.
Regards!
Rahul
And what is your input? Try to prepare a sample qvw and share.
Hi Ram,
Please post any example data, let us try.
Thanks,
Row No | Date | Customer | Sales |
1 | 04/18/12 | Aadi |
|
2 | 04/18/12 | Aadidev |
|
3 | 01/06/09 | Aadil | 121428 |
4 | 01/28/09 | Aadinath | 35625 |
5 | 01/31/09 | Aadir | 35625 |
6 | 02/01/09 | Aadit | 35625 |
7 | 02/19/09 | Aaditeya | 4800 |
8 | 02/22/09 | Aaditya |
|
9 | 02/23/09 | Aadrian |
|
10 | 02/24/09 | Aagam | 114085 |
11 | 02/25/09 | Aagney | 114085 |
12 | 02/26/09 | Aagneya | 179900 |
13 | 02/28/09 | Aahan | 179900 |
14 | 03/01/09 | Aadi | 179900 |
15 | 03/02/09 | Aadidev | 147000 |
16 | 03/03/09 | Aadil | 111308 |
17 | 03/08/09 | Aadinath | 22400 |
18 | 03/10/09 | Aadir | 22300 |
19 | 04/20/09 | Aadit | 255156 |
20 | 04/22/09 | Aaditeya | 255156 |
21 | 04/26/09 | Aaditya | 255156 |
22 | 04/27/09 | Aadrian | 255156 |
23 | 04/28/09 | Aagam | 255156 |
24 | 05/01/09 | Aagney | 255156 |
25 | 04/29/09 | Aagneya | 255156 |
26 | 05/03/09 | Aahan | 255156 |
27 | 05/04/09 | Aadil | 255156 |
28 | 05/05/09 | Aadinath |
|
29 | 05/06/09 | Aadir |
|
Hello Ram,
Trust that you are doing great!
Please refer the sample application attached herewith.
Regards!
Rahul
It works..Great
Cheers,
Rahul
Thanks Rahul
Is there any other way to do the same?
Hello Ram,
We can achieve the same using below sample script:
SalesData:
LOAD DATE#(Date, 'MM/DD/YYYY') AS Date, DATE(DATE#(Date, 'MM/DD/YYYY'), 'MMM YYYY') AS Month, SalesRep, Sales;
LOAD * INLINE [
Date, SalesRep, Sales
01/01/2017, Arun, 12000
01/01/2017, Sam, 11000
01/01/2017, Vinoth, 10000
02/01/2017, Arun, 12000
02/01/2017, Sam, 17000
02/01/2017, Vinoth, 11000
03/01/2017, Arun, 21000
03/01/2017, Sam, 11000
03/01/2017, Vinoth, 11200
04/01/2017, Arun, 22000
04/01/2017, Sam, 31000
04/01/2017, Vinoth, 40000
];
//Get the Total Sales for every month
INNER JOIN
Data:
LOAD Month
,Sum(Sales) AS MonthlySales
Resident SalesData
Group By Month;
//Get the Maximum Sales for every month
INNER JOIN
Data:
LOAD Month
,Max(Sales) AS Sales
Resident SalesData
Group By Month;
Also refer the attached sample application.
Hope this will help.
Regards!
Rahul