Page 1 of 1

Need to implement below logic in datastage 8.1

Posted: Wed Mar 02, 2011 1:40 am
by kalpanam
HI All,

I need to implement below logic in datastage.Please help me out.I have my input data as:

History
Date Store Sku Price
1-Dec-10 A 1 10
1-Dec-10 A 2 12
1-Dec-10 B 1 5
1-Dec-10 B 2 8
1-Dec-10 C 1 15
2-Dec-10 A 1 10
2-Dec-10 A 2 12
2-Dec-10 B 1 5
2-Dec-10 B 2 8
2-Dec-10 C 1 15
3-Dec-10 A 1 7
3-Dec-10 A 2 12
3-Dec-10 B 1 6
3-Dec-10 B 2 8
3-Dec-10 C 1 15
4-Dec-10 A 1 7
4-Dec-10 A 2 12
4-Dec-10 B 1 6
4-Dec-10 B 2 8
4-Dec-10 C 1 15
5-Dec-10 A 1 10
5-Dec-10 A 2 12
5-Dec-10 B 1 5
5-Dec-10 B 2 8
5-Dec-10 C 1 15
and then I need my ouput as below:

Output
Date Store Sku Price
1-Dec-10 A 1 10
3-Dec-10 A 1 7
5-Dec-10 A 1 10
1-Dec-10 A 2 12
1-Dec-10 B 1 5
3-Dec-10 B 1 6
1-Dec-10 B 2 8
1-Dec-10 C 1 15

Could anyone please help me out in achiving this logic.

Thanks & Regards,
Kalpana.

Posted: Wed Mar 02, 2011 2:58 am
by ray.wurlod
Aggregator stage, group by the first three fields, take Max of the fourth.

(Edit based on Craig's feedback)
Filter based on Mod(day_number,2)

Posted: Wed Mar 02, 2011 7:40 am
by jwiles
Not quite right...there are even-numbered days within the source data which are missing from the output data. Those need to be filtered out...

Kalpana, were you given any rules to apply to this data to get the results shown, or were you given just the data and results? And, are the results you show us complete? There are other entries missing in your example (besides even dates) that would be kept using Ray's logic: 3-Dec-10 B 2 8, for example.

Regards,

Posted: Wed Mar 02, 2011 8:17 am
by chulett
:idea:

General rule of thumb: Never simply post an example of your input data followed only by an example of your desired output. By doing so, you are forcing anyone attempting to help to puzzle out the business rule(s) behind how you got from A to B. Help us help you and always include a written explanation of your transformation rules, what exactly it is you are trying to accomplish. That way we don't have to guess.