Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have to table two tables following:
target:
prod q1 q2 q3 q4
A 6 8 5 9
price:
prod start end price
A 1 5 100
A 6 10 200
A 11 20 300
A 21 30 400
expected o/p:
prod q1 q2 q3 q4
A 700 2000 1500 3500
concept:
1.for q1: 6 products then,1-5=100, 5*100=500 ,then remaining 1 is in range 6-10,1*200=200,
now q1=500+200=700
2.for q2: 8 products then,it continous from q1 ie) 8 will be counted to q1(7-14) then 7-10=4*200=800 ,11-14=4*300=1200
now q2=800+1200=2000
similiar for Q3 & Q4 ..
have to implement dynamically...
help needed ..
Thanks ,
Deepak Sibi
Hello Deepak,
Could you please reformulate your question and add example files?
From my understanding it seems that you will have to use the intervalmatch function to expand your intervals ( start - end). For more information about intervalmatch: (IntervalMatch and Slowly Changing Dimensions)
,KR Koen