Quantcast
Channel: SCN: Message List - Data Warehousing
Viewing all articles
Browse latest Browse all 3366

Re: What is the most appropriate APD Transformation to Choose/Select

$
0
0

Hi,

 

I have three queries in APD with three set of data respectively as table 1, table 2 and table 3

 

Table 1

 

StoreDeptSales (Total Last 3 periods)Store Ratio
Store 1Bath3030.2523 (303/1201)
Store 1HDW8980.7477 (898/1201)
Total: 1201

 

Table 2

 

Comp StoreDeptSales (Total Last 3 periods)Store Ratio
Store 4Bath6450.2689 (645/3630)
Store 7HDW29850.7754 (2985/3630)
Total: 3630

 

 

Requirement:


Select Store = Store 1 and Dept = HDW where Ratio =0.2523 then find the close match in Table 2 Store Ratio. When the closest Store Ratio matches is found then the historic sales for the matched Comp Store for period 4, 5 and 6 from Table 3 (Which is another BW Query) should be added to Store 1 as the Store 1 which is non comp store would not have any sales in last year. I.e cloning/copying/replacing the data for the Stores sales for future period 4, 5 and 6 should be done from historic Comp Store. And the logic would be same for rest of the stores by department between two tables.

 

Table 3


Comp StoreDeptLast Year Month Historic Sales
Store 4Bath4230
Store 4Bath5240
Store 4Bath6250
Store 7HDW41050
Store 7HDW51110
Store 7HDW61100


The Final expected result table would look similar to below:


Table 4

 

StoreComp storeDeptMonthHistoric Sales Comp Store (Last year)
Store 1Store 4Bath4230
Store 1Store 7HDW41100
Store 1Store 4Bath5240
Store 1Store 7HDW51050
Store 1Store 4Bath6250
Store 1Store 7HDW61110

 

Question:

 

What Transformation would be appropriate to use to get the desired result. If ABAP Routine is the option can anyone help me with the code?

 

Many Thanks in advance

 

Regards

Sandhya


Viewing all articles
Browse latest Browse all 3366

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>