Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would appreciate hints/help to solve the following scripting related problem:
The data is loaded from several sources and I have problem as there are duplicate product-period-version combinations in the data.
Please see the tables below:
- first table: how the data currently looks
- second table: how the data should look.
How the data looks now:
Product | Period | Version | Amount |
A | 1 | Actual | 10 |
A | 1 | Actual | 10 |
A | 1 | Actual | 10 |
A | 2 | Actual | 10 |
A | 2 | Actual | 10 |
A | 3 | Actual | 10 |
A | 3 | Actual | 10 |
A | 3 | Actual | 10 |
A | 3 | Actual | 10 |
A | 4 | Actual | 10 |
A | 5 | Actual | 10 |
A | 6 | Actual | 10 |
A | 1 | Budget | 11 |
A | 1 | Budget | 11 |
A | 1 | Budget | 11 |
A | 2 | Budget | 11 |
A | 2 | Budget | 11 |
A | 3 | Budget | 11 |
A | 3 | Budget | 11 |
A | 4 | Budget | 11 |
A | 5 | Budget | 11 |
A | 6 | Budget | 11 |
A | 7 | Budget | 11 |
A | 7 | Budget | 11 |
How the data should look:
Product | Period | Version | Amount |
A | 1 | Actual | 30 |
A | 2 | Actual | 20 |
A | 3 | Actual | 40 |
A | 4 | Actual | 10 |
A | 5 | Actual | 10 |
A | 6 | Actual | 10 |
A | 1 | Budget | 33 |
A | 2 | Budget | 22 |
A | 3 | Budget | 22 |
A | 4 | Budget | 11 |
A | 5 | Budget | 11 |
A | 6 | Budget | 11 |
A | 7 | Budget | 22 |
Any hints appreciated!
Ossi
load it like
load
product,
period,
version,
sum(amount)
from
xyz
groupby period;
-Sundar
load it like
load
product,
period,
version,
sum(amount)
from
xyz
groupby period;
-Sundar
Thanks for the hint. Group by it is..
I added all the rest of the dimensions to Group by line and it worked.
Problem solved. Have a nice weekend!
Yeah missed a space...
Thanks a lot..
Have a great weekend...
-Sundar