Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crosstab

Posted on 2009-05-20
16
Medium Priority
?
769 Views
Last Modified: 2012-08-14
Hi,

Is it possible to represent the data A/B fashion in the Crosstab?? I have two different Columns coming from the database. I want to represent then on the Crosstab side by side (Column A/Column B) is this possible...??
0
Comment
Question by:minhajm
  • 5
  • 4
  • 3
  • +1
16 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 24433481
It should be.

Simply add bith fields as the summary fiekds.

mlmcc
0
 

Author Comment

by:minhajm
ID: 24433647
Hi
Sorry I have not understood this. what are bith fields...?? can you pls provide more details.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24434129
When you create the cross tab you can add row and columns and you also can add the fields for the summary.  If you add both A and B you should get what you want.

mlmcc
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 101

Expert Comment

by:mlmcc
ID: 24434134
Sorry that should have been BOTH

mlmcc
0
 

Author Comment

by:minhajm
ID: 24434252
When i add Both fields for summary..in crosstab it shows one below the other...I need it side by side sepearted by "/". Somthing like this (250 / 300) in the same line.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 336 total points
ID: 24434908
I don't think you can get the /.  Side by side is controlled through the Crosstab Expert.  On the CUSTOMIZE STYLE tab set the SUmmarized Fields to horizontal.

Are the values actually sums or are they individual fields?
If individual fields you might be able to use a formula for the value
Something like

CStr({A},0,'') & ' / ' & CStr({B},0,'')

mlmcc
0
 

Author Comment

by:minhajm
ID: 24435468
Hi,

Formula is working great thanks. Can i also have the Background color for the CStr({B},0,"") in this formula.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24435832
As far as I know the background color will apply to the whole cell.  You can't change it for part of the cell.

mlmcc
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 332 total points
ID: 24438412
If you have two numeric fields in the cross-tab, you can get a "/" in between the numbers by adding it to the format for one of the fields.  Note that it won't actually be in between the two fields.  It will be part of one field.  If you were going to export the report to something like an Excel file, that would probably be a problem, because that one field wouldn't be numeric anymore (eg. instead of 250, the field would be 250/).  If you're not going to export the report, then that's not an issue.

 The basic idea is to pick one of the fields, go to the format, enable the currency symbol and change the symbol to be / instead of $.  For example, go to the format for the left field, tell it to show a currency symbol to the right of the number and change the symbol from $ to /.  Then 250 would show as 250/.  Or go to the format for the right field and have it display the currency symbol, fixed, to the left of the number (so 300 would show as "/  300").

 If you want some spaces before/after the /, instead of just typing the / in the currency symbol box, click on the formula (X+2) button to the right and enter a string with the slash and your spaces.  For example:
"   /"

 If you enter spaces in the currency symbol box, CR will just remove them, but not if you put them in the formula.


 If this allows you to use two fields in the cross-tab, then you can change the bg color on one of them.  Just keep in mind that the / will be part of one of the fields, so if you change the bg color on that field, that will include the part with the /.  With that in mind, if you want to change the bg color on the right field, you may want to add the / to the left field.

 James
0
 
LVL 2

Assisted Solution

by:corobv
corobv earned 332 total points
ID: 24440334
Another way to do it is to create a formula called Slash and put " / " in it. Save it and then add it to the summary as a Max or minimum.  Either would work. Place it  in between the two other summaries. Summarized the fields  horizontally as MIMCC suggested above.  Then you should be able to change the color of both or either of the fields, and the  / would remain the default color.
0
 
LVL 35

Expert Comment

by:James0628
ID: 24446853
Nice idea.  I just tried it in a cross-tab here and it worked to a degree.  I did not get a "/" in the cells where both numbers were 0 (meaning that there were no records for that cell).  That field just doesn't show up in those cells at all.  Maybe there's a way around that, but I suspect not.  But if that's not a problem for the OP (either because they don't have any cells like that, or because they don't mind not getting a "/" in the "0" cells), then that may be the best solution yet.

 James
0
 
LVL 2

Expert Comment

by:corobv
ID: 24449653
You could suppress the zeros also.  You have to format the cell go the number tab, click custom and check mark suppress if zero.  That way the entire field will be blank.  
0
 
LVL 35

Expert Comment

by:James0628
ID: 24455879
True.  Of course if there are some cells where one number is 0 and one is not, that might not work so well.  You'd have one number and the "/", but not the other number (0).

 James
0
 
LVL 35

Expert Comment

by:James0628
ID: 25455508
I would give some points to corobv as well, for post 24440334.  His idea of adding a "slash" formula to the cross-tab was simple, and worked well in my test, apart from not showing up when both of the numeric summaries were 0, which may not have been an issue for the OP.

 James
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question