INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Pulling previous data - 2nd stab

Pulling previous data - 2nd stab

(OP)
I am using CR XI

My data is a csv file looks like the following with "<07>" as the delimiter:
B.HL.HL: HL<07>3<07>1<07>25
B.HL.N1.N1: N1<07>WH<07><07>93<07>00806
B.HL.HL: HL<07>4<07>3<07>26
B.HL.N1.N1: N1<07>SN<07><07>93<07>00809
B.HL.HL: HL<07>5<07>1<07>25
B.HL.N1.N1: N1<07>WH<07><07>93<07>00810
B.HL.HL: HL<07>6<07>5<07>26
B.HL.N1.N1: N1<07>SN<07><07>93<07>00007
B.HL.N1.N1: N1<07>SN<07><07>93<07>00008
B.HL.N1.N1: N1<07>SN<07><07>93<07>00009
.
.
.

The end goal is to have each 2nd segment notated by 'SN' (Store#) to also show their respective Warehouse. Both numbers are located after the 4th delimter as a 5 digit code.
The Warehouse segment will have 1 or more stores associated with it in the lines below it.

The line before each Warehouse line indicate the Parent (warehouse) in the 2nd segment (example: B.HL.HL: HL<07>5<07>1<07>25 - here '5' is parent hierarchical code.)
The line after each Warehouse line indicates the reference back to the Hierarchical parent segemnt for all the Stores to follow and is in the 3rd segment.
(example: B.HL.HL: HL<07>6<07>5<07>26 - here '5' - relates back to parent, shown in previous example)

The final data would look like the following:


I have rewritten this completely and hopefully it is a bit more understandable now.
Please let me know if more information is needed.
Disregard the attachment.

RE: Pulling previous data - 2nd stab

OK, I think I now understand the problem, and solved it by creating the following 2 formulas:

CODE --> {@Warehouse}

WhilePrintingRecords;
Global StringVar WH;

If      Split({Table.Customer_816_DATA}, '<07>')[2] = 'WH'
Then    WH := Split({Table.Customer_816_DATA}, '<07>')[5]
Else    WH := WH;

If      Split({Table.Customer_816_DATA}, '<07>')[2] = 'SN'
Then    WH
Else    '' 

CODE --> {@Store}

If      Split({Table.Customer_816_DATA}, '<07>')[2] = 'SN'
Then    Split({Table.Customer_816_DATA}, '<07>')[5] 

Hope this helps.

Cheers
Pete

RE: Pulling previous data - 2nd stab

(OP)
works perfectly,
Thanks so much for your help and patience Pete!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close