Solved

Crosstab

Posted on 2009-05-20
16
729 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 100

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 100

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
 
LVL 100

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 100

Accepted Solution

by:
mlmcc earned 84 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 100

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 34

Assisted Solution

by:James0628
James0628 earned 83 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 83 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 34

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 34

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 34

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now