How to compare 2 columns in a cross tab

Hi,
I need some idea on how to compare 2 columns in a cross tab in Deski.
Original Table is like this:
Type..............ID...........Name
Type1............1............BO1
Type1............2............BO1
Type1............3............BO2
Type2............1............BO7
Type2............2............ --     
Type2............3............BO5
I did Slice and dice to the original table and now it looks like a cross tab
......................1..............2............3
Type1.........BO1....... BO1.......BO2
Type2.........BO7........--     ...........BO5
Now I want to compare column 1&2, 1&3 and put these values in new columns after column 3 for Type1 & Type2
Does anyone has any idea on this?
Thanks,

1. Right click your table
2. Select Calculations -> Count
3. It will insert a new column. Edit this new column formula and substitute it with thos other formula:
=If ( <Name> Where (<ID>=1)  = <Name> Where (<ID>=2)  ) Then "Column 1 equal to column 2" Else "They're not Equal"
4.Put this title in that column's header:
Column 1 vs Column 2
5. Repeat steps for comparison between 1 and 3, just that this is the formula you have to use:
=If ( <Name> Where (<ID>=1)  = <Name> Where (<ID>=3)  ) Then "Column 2 equal to column 3" Else "They're not Equal"
Note: Apply necessary changes depending on what you need.
Edited by: PadawanGirl on Jul 4, 2011 10:32 PM

Similar Messages

  • Sorting column name in cross tab

    Hi Experts,
    How to sort the column name in cross tab.Crystal is sorting alphabetically like
    Apr 2013 Apr 2014 Aug 2013 Aug 2014 Dec 2013 Dec 2014 Feb 2013 Feb 2014 Jan 2013 Jan 2014............................so on
    But i need result like
    Jan 2013 Jan 2014 Feb 2013 Feb 2014 Apr 2013 Apr 2014 Aug 2013 Aug 2014  Dec 2013 Dec 2014
    I am using crystal report 2013 version.
    Kindly see the attached file

    Hi Bharathiraja,
    Instead of using a string field to display the month names, use a Date field as the column of the Crosstab.
    You can then, highlight the column in the crosstab expert > Options > Options tab > check 'Customize group name field' > click the formula button beside 'formula' and use this code:
    Totext({DATE field}, 'MMM yyyy')
    -Abhilash

  • How can I compare two summary field in cross-tab?

    <p>Dear expert:</p><p>I have one question for how can I compare two summary field in cross-tab?  I have following cross-table:</p><p>Type          Sector1     Sector2    Sector3       Total </p><p>Outlook         10            11           9              30         </p><p>Target            5              3           1               9</p><p>I want to compare the summary field(total) relationship percent, I want to get "9/30". Someone told me I must create the DB view or table via SQL, then can implete in Crystal Report. Can I implete it in Crystal Report via fomula or other function?</p><p>Thanks so much for your warm-hearted help!</p><p>Steven</p>

    Hello Steven, yes you can compare summary fields, If you are comparing Summary to Target, or vice versa - you can do it within Crystal Reports.
    1. In Suppress conditional formula, create 2 Global variables: CurrentOutlook and CurrentTarger and get the current value.
    2. In Display String formula for Total show ToText(CurrentTarget/CurrentOUtlook) + "%".
    For more difficult cases of compariing fields in cross--tab, you may look into http://www.relasoft.net/KB10001.html.
    Best,
    Alexander

  • Setting Total Column width in Cross Tab report

    I am having an issue with the width of the Total Column in a Cross tab report. I have set the width of the column and saved the report but when I am reopening the report the Total column width is expanded but rest of the data column width remains the same (which I saved). Any idea how to adjust the total column width?
    TIA,
    AJ

    AJ.
    Did you ever solve this?

  • How to arrange month in order in cross tab in crystal report

    Hi all,
          we are using cross tab to arranging the data (month wise)  in crystal report. we have month in string format like jan2008. this field is in column of the cross tab. now we need to arrange the month in sorted order. At Present , the month is displayed as april2007, arpil2008, april2009,may 2007, may 2008, may 2009.
      now i want in this order. april 2007, may 2007, april 2008, may 2008, april 2009, may 2009. how to achieve this in crystal report.
    Regards,
    Shanthakumar.

    Try this,
    Create a new formula
    For example, "April 2009" is stored as string in {TABLENAME.FIELDNAME}
    datevalue("1 "&{TABLENAME.FIELDNAME});
    Now you have a date, composed of your year, your Month and 1.
    you can use it to order your data by date.
    If sometimes there is no blank between month and year ("April2009") try this
    local stringvar x;
    x:={TABLENAME.FIELDNAME} ;
    x:=left(x,length(x)-4)&" "&right(x,4);
    x:=replace(x,"  "," ");
    datevalue("1 " & x);
    regards,
    zettels.

  • Can we apply sorting on Column values in Cross tab??

    Can we apply sorting on Column values in Cross tab??
    Following is the scenario with me.
    I have 2 fields and one formula.
    Fields are HostName and Username.
    Formula is status which categorizes the Authorized and Unauthorized events.
    And in the Summary Field, I am calculating the total number of events.
    In cross tab, Fields are marking the Rows of the cross tab and Formula is making the Columns(Authorized and Unauthorized ) of the cross tab.
    Since in cross tab data is grouped from left to right and sorted by default. I want to remove this default sorting and want to put sorting on the formula for Unauthorized events.
    Is there any way to fulfill this requirement?

    Hi,
    You can assign a number to each Unauthorised field e.g
    Rank   Unauthorised
    1         A
    2         BC
    3         DF
    5         TD
    6         GF
    Then add "Rank" to the crostab Columns before the Unauthorised  field. Then you can control the sorting order on your crosstab.
    Hope this helps
    Regards
    Dotun

  • How to compare all columns in a SELECT with all columns in a Cursor ?

    Hi All,
    I would like to know if something like this is possible in PL/SQL
    I have a cursor CUR1 which is a SELECT * FROM T1.
    And in my loop for every record found in CUR1 I am trying to retrieve its consecutive record in the table T2. Unfortunately T1 and T2 do not have a primary key so there are duplicates. But if I can compare each column of CUR1 with its respective column in T2, I can find the record. But the question is how ?
    So I tried something like this, but of course this is wrong, but hope this would give you an idea of what I trying
    VAR_T2 T2%ROWTYPE;
    CUR_T1 IS SELECT * FROM T1
    LOOP CUR_TI
    SELECT * INTO VAR_T2
    FROM T2 WHERE
    ‘ALL COLUMNS OF T2’ = ALL COLUMNS OF CUR1;
    So is there a easy way to accomplish this. Thank you, AJ

    As Walter says, this is simply an intersect if you are comparing all the columns.
    However, if you really must do it in a slow by slow, PL/SQL loop (no real valid reason why you would though)...
    DECLARE
      VAR_T2 T2%ROWTYPE;
      CUR_T1 IS
        SELECT * FROM T1;
    BEGIN
      FOR i IN CUR_TI
      LOOP
        SELECT * INTO VAR_T2
        FROM T2
        WHERE T2.col1 = i.col1
          AND T2.col2 = i.col2
          AND T2.col3 = i.col3
          AND T2.colN = i.colN;
      END LOOP;
    END;There is no simple mechanism for just saying "compare all the columns", you will have to specify each one individually in the WHERE clause.

  • How to create a title over the top of the left-most column in a cross-tab.

    This is one of those things that seems simple until you try it.
    I'm almost there.  I moved the cross-tab from the report header to the report footer so I can have a page title.  I tried using an overlay but it didn't work for any page past the first.
    I can't seem to figure out how to put a title over the left-most column though.
    Thanks in advance,
    J

    I have used a text box, after you type in the text, select the box, and move it to the front.
    then select the crosstab and move it to the back.

  • How to compare 2 columns with data like...

    Hi,
    I have to compare 2 columns from 2 different tables the columns contain data like
    SELECT CIRCLE FROM RATE_PLAN
    OUTPUT
    (AP,NAT)
    (AS,NAT)
    (BH,NAT).
    SELECT CIRCLE FROM subscriber_info
    (AP,NAT)
    (AS,NAT)
    (BH,NAT)
    but when i put a join on the tables on this column i get the ouput as -0 rows returned
    select col1,col2 from rate_plan,subscriber_info
    where
    rate_plan.CIRCLE=subscriber_info.CIRCLE
    HOW DO I COMPARE THE 2 COLUMNS SO THAT I GET MATCHING RECORDS??
    NOTE:-DATATYPE OF BOTH THE COLUMNS IS SAME.

    Hi,
    using SQL*Plus can you cut and paste the result of following commands :set tab off
    set trimout on
    set trimspool on
    desc rate_plan;
    SELECT '-'||CIRCLE||'-' c FROM RATE_PLAN ;
    desc subscriber_info;
    SELECT '-'||CIRCLE||'-' c FROM subscriber_info ;And be sure to use the tags {noformat}{noformat} before and after the pasted output.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Date Formatting in Charts and Dynamic column resizing in Cross tabs

    Hi All,
    I am new to Design Studio, so am in desperate need of your help on the following:
    Is there a way we can change the date format in x axis in charts?
    For ex: Am getting dates as mm/yyyyy from BW but requirement is to show in yy-Mon
    Requirement is to display data in cross tab just below the charts. How can I make the column widths in the cross tab the same as x-axis divisions in the chart? Also, this will be dynamic as depending on filter selection x axis scaling in charts will vary.
    In cross tab, can I hide the column header?
    Would really appreciate any kind of help from you.
    Thanks & Regards
    Swasti

    HI Swasti,
    To answer your first question, in Design Studio it's what you see is what you get! so it shows the Data Labels as it is in the BEx output, if you have to modify this you have to change it in the Background.
    There might be CSS workarounds, but I am not sure if that will satisfy your requirements.
    You can fix the Column width, but it would be constant, aligning that to your X-axis would require a lot of Effort.
    You cannot hide the Column header directly, but one workaround would be to use a white BG text component to overlay on the Crosstab.
    Regards,
    Fazith Ali Z

  • How to refernce the field in the cross-tab report

    Hello,
    I'm trying to refer to the field in the cross-tab report using GridRowColumnValue function.
    The field name in formulas is DevelopmentTracking_SELECT.Completed, so I'm trying to refer like this:
    GridRowColumnValue("DevelopmentTracking_SELECT.Completed")
    I'm getting:
    "This is not the name of a grid group for the field being formatted."
    I've tried different way - gave the name of the field, for instance, or used the name form the Cross-tab expert - Max of DevelopmentTracking_SELECT.Completed, or simply use "Completed" - nothing worked.
    I see the possible cause for it. DevelopmentTracking_SELECT.Completed is not a row or column name, in the Cross-tab expert this is a Summarized field. How to reference the field like this correctly?
    Thank you,
    Peter
    Edited by: Peter Afonin on Feb 17, 2009 9:52 AM

    Oh I thought it is
    ROW: Product Name
    COLUMN:  Anticipated Date, Completed
    SUMMARIZED FIELDS: Product Stage
    Anyhow try to move the Completed field above the Anticipated Date in SUMMARIZED FIELDS by clicking up arrow.
    Now right click on the field Completed go to format field-->write the suppress condition like this
    WhilePrintingRecords;
    boolenavar i;
    i:=CurrentFieldValue;
    false
    Now right click on the Anticipated Date field and go to font and write the condition for color like this
    WhilePrintingRecords;
    boolenavar i;
    If CurrentFieldValue &gt;= CurrentDate Then
    crGreen
    Else If CurrentFieldValue &lt; CurrentDate And i=False Then
    crRed
    Else
    crBlack
    I hope this helps!
    Raghavendra

  • Filtering Key Figures/Columns in a Cross Tab Component

    Hello All,
    I am creating a P&L Statement for Better/Worse comparisions, and I have to show only three columns at a time based on User Drop Down Selections.
    Here is my Bex Query Out put looks like.  The Rows part is "Structure" and Columns are "Cell Restrictions".
    Now, the CrossTab component has to show only Two columns at a time, based on user selections. Here is my desired output. User will Select either ' Avg' Rate or 'End Rate'. Based on that selction, Actual's will show in the First Column and based on Selection from Second DROPDOWN for Budget/Forecast/PY, the Second Column has to be displayed.
    Is there any DropDown Component or CrossTab Component Options are there to Filter the Columns based on User Selections ?
    Appreciate your help. This is the Crucial Chart for the whole Dashboard.
    Thanks,
    Sonti.

    Hi Tammy,
    Thanks for your quick reply.
    Can it be done dynamically without the User touching it ? My Cross Tab has to show values based on the Selctions. But, I couldn't find the code to restrict Cross Tab data.
    I have to code for Dropdown box --> On Select, to check / Un check the KF's in the Filter Panel Component. And in Filter Panel Comoponent, --> On Select, DATASOURCE.setFilterExt("KF1", "KF2").
    And assign the data source to Cross Tab.
    Please correct me if I am wrong.
    Regards,
    Sonti.

  • How to display Zero(0) values in cross tab format in Webi???

    Hi All,
    Is there a way to display the zero(0) or null values in cross tab format in
    webi. I can able to display in Regular tabular format in Webi as u got an option
    in Properties --> Display --> Show all rows/columns, but it is not working when
    i am using Cross Tab format for the same data.
    Regards
    Ram

    Hi Sunil,
    Happy to see your solution. My requirement is that if you have a data like
    SBU,                   Cadre,                Value
    Chemical Buss,     Manger,                  45
    Crop Buss,            Workmen,               63
    Agri Buss,              Executive,              70
    Chemical Buss,     Executive,              84
    Agri Buss,              Workmen,              -      
    Crop Buss,                 -,                        -
    So now we need to get the rows or columns that are having blank values. Say like if Crop Buss is not having any values so it wont be displayed, but actually it has to be displayed.
    Regrads
    Ram

  • Conditional Formating of rows and columns in template(cross tab)

    Hi,
    I am developing a cross tab report in which I have row header as the year like 2008,2007,2006....column header as months jan,feb,mar...and the data area contains the respective data...I need to format the background color of the rows and columns which are below the date of the report(report is ran for a particular month like mar-08)..I was able to format the background color of all the rows that fall below(ex:08) the year of the report(using <?if@row:row_name<'$first'?> <xsl::attribute name="background-color" xdofo:ctx="incontext">#C0D27F</xsl::attribute><?end if?>)..
    and I need to format the 3(till march) columns in the yr 2008
    Thanks...

    Hello..
    Thanks for the reply...
    I have report date as mm|yyyy...below is a sample data of the cross tab..
    <Q1>
    <REPORT_DATE>04|2005</REPORT_DATE>
    </Q1>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>JAN</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2004</BEGIN_DATE>
    <NET_ROR>1.32</NET_ROR>
    <ACTUAL_DATE>01/01/2004</ACTUAL_DATE>
    <FUND_FACT_YTD>7.942192987387475647074276803933198866</FUND_FACT_YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>JAN</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2005</BEGIN_DATE>
    <NET_ROR>-.21</NET_ROR>
    <ACTUAL_DATE>01/01/2005</ACTUAL_DATE>
    <FUND_FACT_YTD>5.739540457478967975310388578877768035</FUND_FACT_YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>FEB</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2004</BEGIN_DATE>
    <NET_ROR>.59</NET_ROR>
    <ACTUAL_DATE>02/01/2004</ACTUAL_DATE>
    <YTD>7.942192987387475647074276803933198866</YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>FEB</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2005</BEGIN_DATE>
    <NET_ROR>1</NET_ROR>
    <ACTUAL_DATE>02/01/2005</ACTUAL_DATE>
    <YTD>5.739540457478967975310388578877768035</YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>MAR</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2004</BEGIN_DATE>
    <NET_ROR>0</NET_ROR>
    <ACTUAL_DATE>03/01/2004</ACTUAL_DATE>
    <YTD>7.942192987387475647074276803933198866</YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>MAR</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2005</BEGIN_DATE>
    <NET_ROR>-.2</NET_ROR>
    <ACTUAL_DATE>03/01/2005</ACTUAL_DATE>
    <YTD>5.739540457478967975310388578877768035</YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>APR</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2004</BEGIN_DATE>
    <NET_ROR>-.07</NET_ROR>
    <ACTUAL_DATE>04/01/2004</ACTUAL_DATE>
    <FUND_FACT_YTD>7.942192987387475647074276803933198866</FUND_FACT_YTD>
    </Q4>
    <Q4>
    <CLASS_ID>1</CLASS_ID>
    <MONTH_BEGIN_DATE>APR</MONTH_BEGIN_DATE>
    <BEGIN_DATE>2005</BEGIN_DATE>
    <NET_ROR>-.87</NET_ROR>
    <ACTUAL_DATE>04/01/2005</ACTUAL_DATE>
    <YTD>5.739540457478967975310388578877768035</YTD>
    </Q4>
    MONTH_BEGIN_DATE goes as the column header, BEGIN_DATE goes as the row header and NET_ROR is the data area..I need to get the background color of each cell of NET_ROR below the report date as one color...
    Thanks ..

  • Column dissappeared in Cross tab with specific order

    Hi experts,
    I have a cross tab, with 2 columns from YEAR (2009, and 2010). Then I created a other column with the differences of both columns before, I changed the SPECIFIC ORDER and the 3th column is DISAPPEARED!!!
    I dont understand why!!
    thank you very much

    At the beggining i have the following columns:
    2009 2010 Desviation
    I created this with specifciar order.
    Then, I want to change the order and I put :
    2008 2009
    but the desviation is disappearing.
    thank u

Maybe you are looking for

  • What is the policy of RepaintManager ?

    Hi all, Can anyone explain to me the policy of RepaintManager ? meaning how RepaintManager decide how to join repaints ? thanks zlzlzl

  • Is it possible to rename an ASM folder?

    i want to rename an ASM folder containing my database: +DBDNL2_G2_DATA_AREA/EVJA/DATAFILE to +DBDNL2_G2_DATA_AREA/DITOC/DATAFILE I do not want any file movement or file copying, just rename the folder and afterwards I rename the datafiles of the data

  • WiFi Access via AEBS in 4 Minutes or Less

    The average connect time for either my 12" iBook or 17" pBook is 3m40s -- and then the modem in my AEBS resets within a few seconds (rather than the usual half minute or longer). As of this posting the behaviour is now half a day old. Prior to that,

  • Nokia 6120 Classic problem

    Hi everyone, I was directed here from another forum, and was hoping that someone could give me some good news. I turned my phone off for about an hour today, and when I turned it back on, everything in the "Messaging" folder was deleted except for th

  • Field symbols im samrt forms

    HI gurus in smart forms in global definitions there is a tab called field symbols wat for it is used and how to use it can any body explain me with an aexample