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.
Need to implement below logic in datastage 8.1
Moderators: chulett, rschirm, roy
Need to implement below logic in datastage 8.1
Kalpana Marupudi
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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)
(Edit based on Craig's feedback)
Filter based on Mod(day_number,2)
Last edited by ray.wurlod on Wed Mar 02, 2011 3:44 pm, edited 2 times in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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,
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,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
![Idea :idea:](./images/smilies/icon_idea.gif)
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers