Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do while loop help. 1

Status
Not open for further replies.

skurkal

IS-IT--Management
Apr 6, 2005
37
US
Hi All,

I am using Crystal XI and have an excel file that has the following data.

Mark
B
X
X
R
X
X
B
X
R


So what I want to do is that between the B and the R I want to change all the X's into B's until I find and R. Then mark all the X's into R's until I find a B. and so on. So the result should be


Mark
B
B
B
R
R
R
B
B
R
etc.

Any help on this would be great.
Thanks!

 
skurkal,

Create the following formula and place it on the details line.

{@FinalMark_Swapped}
Code:
[blue]WhilePrintingRecords[/blue];
[blue]StringVar[/blue] CurrentOutput;

[blue]IF[/blue] {Table.Mark} [blue]in[/blue] ["B","R"] [blue]THEN[/blue] CurrentOutput:={Table.Mark} [blue]ELSE[/blue] CurrentOutput:=CurrentOutput;

CurrentOutput;

Cheers!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top