# Thread: Splitting Into Rows Based on Values

1. Junior Member
Join Date
Jun 2012
Posts
5

## Splitting Into Rows Based on Values

I couldn't find a really analogous example or discussion anywhere, so I thought I'd throw this out there:

I'm getting a row of data from an external source that contains a "first" integer value (say, 5) and a "total" integer value (say, 4), like: Blah|Blah|1|4. The remaining fields would remain the same, but I would need 4 separate rows which would read:
Blah|Blah|1|4
Blah|Blah|2|4
Blah|Blah|3|4
Blah|Blah|4|4

Thoughts? Only possible via UDJC?

Thanks,
Sam

2. Senior Member
Join Date
Apr 2008
Posts
4,696
Originally Posted by spierron
I'm getting a row of data from an external source that contains a "first" integer value (say, 5) and a "total" integer value (say, 4),
Where does the 5 fit into your sample?

Perhaps give us sample incoming and outgoing rows so we can better guide you.
Perhaps you might also want to look at the Clone Rows step.

3. Junior Member
Join Date
Jun 2012
Posts
5
Originally Posted by gutlez
Where does the 5 fit into your sample?

Perhaps give us sample incoming and outgoing rows so we can better guide you.
Perhaps you might also want to look at the Clone Rows step.
Whoops!

That should have been:
Blah|Blah|5|4

Resulting in:
Blah|Blah|5|4
Blah|Blah|6|4
Blah|Blah|7|4
Blah|Blah|8|4

4. Junior Member
Join Date
Jun 2012
Posts
5
I tested the Clone Rows step...when I checked it out the first time, I didn't quite get it...I think I may have it squared away now by doing some simple addition and subtraction in conjunction with the Clone Rows step. Not exactly elegant, but it definitely seems to work! Thanks!

5. Junior Member
Join Date
Jun 2012
Posts
5
For posterity, here was my solution:

-[Whatever data input step to get Field 1 (str), Field 2(str), InitValue (int), TotalValue(int)]
-Add constant step [Field SingularSensation, Type Integer, Value 1]
-Calculator step [New field: "cloneRows", Calculation: A-B, FieldA: TotalValue, FieldB: SingularSensation, Value type: Integer]
-Clone Row step
-Calculator step [New field: "FinalValue", Calculation: A+B, FieldA: InitValue, FieldB: InitValue_1, Value type: Integer]
-[Whatever data output step to present Field 1 (str), Field 2(str), FinalValue (int), TotalValue(int)]

I don't see any reason why this wouldn't work perfectly well for any case like this...I smell an intern/jr dev project to create a plugin for contribution for future usage, since I know this is something we'll use all the time, and perhaps others would as well, and a pluign would look a whole lot nicer than this mess.

Thanks again.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•