calculating sub totals

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
jastichoudaryuu
Participant
Posts: 12
Joined: Mon Jan 31, 2011 7:19 am

calculating sub totals

Post by jastichoudaryuu »

Hi,
iam new to datastage and am in learning stage. please let me know how to break coloumns to get subtotals in other row.

sample ip

id|colA|colB
1|x|z
2|y|t
1|a|b
3|c|d

desired output

1|x|z
1|a|b
1|2|
2|y|t
2|1|
3|c|d
3|1|


iam just practicing this scenario, after making derivation am getting like below output

id|colA|colB
1|a|b|
1|x|z**BREAK**1|2
2|y|t**BREAK**2|1
3|c|d**BREAK**3|1

now how to break columns to get subtotals

i used unix command in sequential stage filter option its not working properly.
and how can it take new row(sub total value) without assigning.
please let me guide.
Thanks in advance :?
anilkumar
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

Try this

Use a "Copy" to split records, Link One goes to "Funnel". Link Two goes to "Aggregator" and same "Funnel."

and then output from "Funnel" to "Sequential File"

Make sure that all meta-data is fed correctly in Funnel.
Hope this helps.
Post Reply