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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula for multiple field values in one line of a cross tab

Status
Not open for further replies.

winney

Programmer
Jan 24, 2003
14
CY
I have the following table:
PNO MBDID ITEMCD ITEMFLTCD SFACT_CD FVALUE
------------------------------------------------
17 5 101 1 HANDNP 565.66
17 5 101 1 OOSNP 564.45
17 5 101 1 HANDW 213.22
17 5 101 1 OOSW 0.00

So, for any unique compination of PNO, ITEMCD, MDBID, ITEMFLTCD there are 4 different values fot sfact_cd(HANDNP,OOSW,HANDW & OOSW)
I have created a report using Crystal Reports 8.5, with two grouppngs 1.ITEMCD 2.PNO and I have also a cross tab with row:ITEMFLTCD and column:MBDID
The problem is that in the summarized fields I want to 'concatenate' FVALUE values for 4 SFACT_CD values
I created 5 formulas @F1,@F2,@F3,@F4, @FAll

Formula1: @F1
IIF (Trim ({bat2delive.sfact_cd})="HANDNP",CStr (Round ({bat2delive.fvalue})),Space (4))

The other 3 formulas (@F2,@F3,@F4) follow the same logic and @FAll concatenate the other in one
{@F1} + {@F2} + {@F3} + {@F4}

So in the summarized fields I put only the last formula @FAll, but I take no results
I change the grouppings but that was not a solution because the cross tab changed also.
If anyone have any solution please let me know

Thanks



 
If these are 4 different records, Crystal will not be able to concatenate them as a summary.

What is your output supposed to look like? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks for replying
The output should have the following format:
In the page header there are the values of the 2 groupping 1.ITEMCD 2.PNO.
And in the group 2 Footer there is the cross tab which have to have the following layout (for the data I put above):
5(mbdid)
---------------------------------------------------------------
1 (ITEMFLTCD) /565.66(FVALUE for SFACT_CD=HANDNP) 564.45 (for OOSNP )
/213.22 (for HANDW) 0.00 (for OOSW )
---------------------------------------------------------------

565.66, 564.45,213.22&0.00 should be in the ssame cell of the cross tab


 
I don't see a way to do that in a cross-tab. You could try a manual cross-tab as described in faq149-243, but this requires a fixed number of colums. There is also a formula in faq149-243 that shows how to concatenate values from several records into one string. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top