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!

Formula to show data in multiple columns 1

Status
Not open for further replies.

tank14

IS-IT--Management
Sep 30, 2003
3
US
I'm very new to Crystal Reports (9.0) and would like some help with a formula that would make this:

AS.TKT AS.DCTY AS.ACTY
7999126855 GEG PHX
7999126855 PHX ATL
7999126866 AMS ATL
7999126866 ATL MCN
7999126867 TPA ATL
7999126867 ATL LGA
7999126867 JFK LGW
7999126867 LGW TPA
7999126774 YUM PHX
7999126774 LAS ATL


Look like this:

7999126855 GEG PHX ATL
7999126866 AMS ATL MCN
7999126867 TPA ATL LGA JFK LGW TPA
7999126774 YUM PHX LAS ATL

Note: If the 2nd DCTY of a TKT is the same as the 1st ACTY of the same TKT, then it is supressed.

Thanks.
 
hi
check this thread
faq149-243

cheers

pgtek
 
This is a quick solution, it doesn't do the suppress on the same city, but it will give you a starting point to work on that from...it returns the data like this.

AS.TKT {@Display TKTDETAIL}
7999126774 YUM - PHX / LAS - ATL /
7999126855 GEG - PHX / PHX - ATL /
7999126866 AMS - ATL / ATL - MCN /
7999126867 TPA - ATL / ATL - LGA / JFK - LGW / LGW - TPA /

=============================

A.) Insert Group on AS.TKT

B.) Create these Formulas

{@Set TKTDETAIL Blank}
WhilePrintingRecords;
stringVar TKTDETAIL := "";


{@Display TKTDETAIL}
WhilePrintingRecords;
stringVar TKTDETAIL;


{@Add TKTDETAIL}
WhilePrintingRecords;
stringVar TKTDETAIL:= TKTDETAIL + " " + {AS.DCTY} + " - " + {AS.ACTY} + " /";

C.) Insert {@Set TKTDETAIL Blank} in the GroupHeader section, {@Add TKTDETAIL} in the Detail section and {@Display TKTDETAIL} in the GroupFooter.

Hope this helps...
 
Thanks pgtek & MJRBIM for your quick response !


I've figure out how to do the linear placing using Multiple Columns, but I can't supress the same city.

Any other Ideas?
 
Tank14 -

Make sure that you have a field in the data to sequence the data (ie. Time/Date/SequenceNumber), then change the Formula "Add TKTDETAIL" to the formula below.

{@Add TKTDETAIL}

WhilePrintingRecords;
stringVar TKTDETAIL;
IF {AS.DCTY} = Right (TKTDETAIL,3) THEN TKTDETAIL := TKTDETAIL + " " + {AS.ACTY} ELSE TKTDETAIL := TKTDETAIL + " " + {AS.DCTY} + " " + {AS.ACTY};


Report will return like this...

AS.TKT AS.SEQ AS.DCTY AS.ACTY
===============================================
7999126774 1 YUM PHX
7999126774 2 LAS ATL
7999126774 YUM PHX LAS ATL

-----------------------------------------------
7999126855 1 GEG PHX
7999126855 2 PHX ATL
7999126855 GEG PHX ATL

-----------------------------------------------
7999126866 1 AMS ATL
7999126866 2 ATL MCN
7999126866 AMS ATL MCN

-----------------------------------------------
7999126867 1 TPA ATL
7999126867 2 ATL LGA
7999126867 3 JFK LGW
7999126867 4 LGW TPA
7999126867 TPA ATL LGA JFK LGW TPA

-----------------------------------------------
 
This works GREAT !!!!!
Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top