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!
  • Students Click Here

*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.

Students Click Here


Move Field(s) into Column(s)

Move Field(s) into Column(s)

Move Field(s) into Column(s)


I want to move a field into a column at each change in [condition]. For each person in my data set, I want to put each of their memberships for the year in a new column. Basically, each person has a single row, even if they have multiple memberships. Each membership would become a new column instead of a new row, but the other data pertinent to the persons record would only output once.

[Column 1] [Column 2] [Column 3] [Column 4]
John Smith Phone Membership 1 Membership 2

RE: Move Field(s) into Column(s)

One way to do this is with Shared variables.

First Group on your Member, then split the group footer in two. Suppress the group header, detail, and the second group footer.

Create a formula like this:
shared stringvar memb1 := ' ';
shared stringvar memb2 := ' ';
shared stringvar memb2 := ' ';

put that formula in the Report Header and in the second part of your group footer.

Now create this formula
// memblist
shared stringvar memb1;
shared stringvar memb2;
shared stringvar memb3;
if memb1 = ' '
then (memb1 := {table.membership} ; memb2 := memb2; memb3 := memb3)
if memb2 = ' '
then (memb1 := memb1; memb2 := {table.membership}; memb2 := memb3)
if memb3 = ' '
then (memb1 := memb1; memb2 := memb2; memb3 := {table.membership})

put that formula in your detail section

Then create a formula like this for each of the variables:
// shomem1
shared stringvar memb1

and place them in the first half of your group footer.

RE: Move Field(s) into Column(s)

Thank you! I think I finally got it working. I actually had up to 12 different memberships, each with the output of conditional messaging. I appreciate your help.

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!

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