Single row to multiple rows with multiply

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Madhusudhan
Participant
Posts: 5
Joined: Mon Feb 07, 2011 1:17 am
Location: madhu

Single row to multiple rows with multiply

Post by Madhusudhan »

DS version : 8.0.1
AIX

I have below requirement. Please give me suggestion.

Source :

col 1 | count | multiplier

a|4|10
b|2|20


I want output like this.

a|1|10
a|2|20
a|3|30
a|4|40
b|1|20
b|2|40

Thanks in advance
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

You may start here here and you might come up with a simpler approach.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Another suggestion? Upgrade. Your solutions are being limited by the age of your version. Transformer looping (introduced in 8.5 from what I recall) would give you a better solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This would be simpler if you had DataStage 8.7 or higher, which support loops within a transform stage.
If your multiplier (4 and 2 in your example) is a small number and the highest number known, you could make one output per possible value all going to a funnel stage.
If your multiplier can have more values than are comfortably programmed into a transform stage, then the solution isn't quite as easy or straightforward and you could follow some of the recommendations in the thread linked to above.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

ArndW wrote:This would be simpler if you had DataStage 8.7 or higher, which support loops within a transform stage.
Small correction. 8.5 or higher
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Madhusudhan
Participant
Posts: 5
Joined: Mon Feb 07, 2011 1:17 am
Location: madhu

Post by Madhusudhan »

Am at client Location.

Upgrade not posmsible. Please give another solution.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Solution other than upgrade is posted in my first post.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which is also why I noted that it is another solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply