Display two different column types in cross tab

I am using Cross Tab template in crystal XI and I have to show two different column types one is of type int and other is of type string. Below is the format of the report
                              AmountGiven             Amount Spent            Attended
Mike                       5000                              3000                         Yes
Steve                     200                                 200                           No
Is there a way I can do this showing "yes" or "no" in the third column???
Thanks...

Hi
If you are trying to show "yes" or "no" for a column value in a cross tab, then yes we can try using a formula for it.
I would suggest you 2 ways that you can try at your end:
1.
a) Create a formula in the cross tab expert and write your condition.
for eg: if Sum({Orders.Order amount}) > 5000 then "yes" else "no"
b) Then select that formula in the summarized fields in cross tab expert and change the summary to MODE.
c) You can see the "yes" and "no" Within the same box.
2.
a) Add a field to the colums in the cross tab expert.
b) A column gets inserted in the cross tab.
c) Right click the field and select format field.
d) Go to Common tab and write a formula for the display string.
e) Write the condition in that formula.
f) You can see a new column with the expected values.
Hope this helps you..
Please revert incase of any queries.
Regards
Pradeep Hulke

Similar Messages

  • 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

  • Two different condition types in one report

    Hello,
    i have a problem with the conditional display of a report.
    I want to use two different condition types for one report.
    For example I want to show the report only when the page is not in printer friendly mode and when the value of an item is NULL.
    Is that possible?
    Has anyone a solution for this problem?
    Thank you,
    Tim

    Tim,
    you can use
    IF V('PRINTER_FRIENDLY') = 'YES' AND :P1_ITEM IS NOT NULL THEN RETURN FALSE;
    ELSE RETURN TRUE;
    END IF;
    in the Conditional Display picking PL/SQL Function Body returning a Boolean.
    Denes Kubicek

  • 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

  • JComboBox display two different lists

    I have a JComboBox in a JTable column. The requirement is that the JComboBox displays two different lists based upon which mouse button is clicked on the JComboBox. i.e When user clicks on mouse Button1 the JComboBox should popup with a list of products(user default products). But, when the user clicks on mouse Button2 the JComboBox should popup with a different list of products(all the products).
    Any help will be appreciated,
    Thanks in advance!

    UNDEBUGGED, UNTESTED, OFF THE CUFF CODE
    public class myEditor extends AbstractCellEditor implements TableCellEditor {
      private int sel = 0;
      private String[][] str = {{"Option 1", "Option 2", "Option 3"},
                            {"Select 1", "Select 2", "Select 3"}};
      private JComboBox[] fieldCombos = new JComboBox[str.length];
      private DefaultCellEditor[] fieldEditors = new DefaultCellEditor[str.length];
      public myEditor() {
        for (int i=0; i<fieldEditors.length; i++) {
          fieldCombos[i] = new JComboBox();
          for (int j=0; j<str[0].length; j++) {
            fieldCombos.addItem(str[0][j]);
    fieldEditors[i] = new DefaultCellEditor(fieldCombos[i]);
    public Component getTableCellEditorComponent(JTable table, Object value,
              boolean isSelected, int row, int column) {
    fieldCombos[sel].setSelectedItem(value);
    return fieldEditors[sel];
    public void setSelector(int Selector) {
    if (Selector>=0 && Selector<str.length) sel=Selector;

  • Getting DISTINCT count from two different columns

    Hi all,
    I have following query which gives currency code from two different tables. I would like to get the distinct count of currency codes from these two different columns.
    SELECT eb.person_seq_id, eb.bonus_amount, eb.currency_cd, ed.currency_cd_host
    FROM fr_emp_bonuses eb, fr_emp_details ed, fr_periods p
    WHERE eb.person_seq_id = ed.person_seq_id AND ed.period_seq_id = eb.period_seq_id
    AND ed.period_seq_id = p.period_seq_id AND p.period_status = 'CURRENT'
    AND eb.bonus_amount >= 0 AND eb.person_seq_id = 3525125;
    This query gives following result
    3525125     240000     USD     INR
    3525125     0      USD     INR
    3525125     60000      USD     INR
    3525125     50000      USD     INR
    There are two distinct currency codes (USD, INR) and total amount is 350000. So I am looking for a query to give me the following result
    3525125     350000 2
    Thanks in advance

    Hi,
    Here's one way:
    WITH     original_query     AS
         SELECT  eb.person_seq_id
         ,     eb.bonus_amount
         ,     eb.currency_cd
         ,     ed.currency_cd_host
         FROM     fr_emp_bonuses         eb
         ,     fr_emp_details          ed
         ,     fr_periods          p
         WHERE      eb.person_seq_id    = ed.person_seq_id
         AND      ed.period_seq_id    = eb.period_seq_id
         AND      ed.period_seq_id    = p.period_seq_id
         AND      p.period_status         = 'CURRENT'
         AND      eb.bonus_amount     >= 0
         AND     eb.person_seq_id    = 3525125
    ,     unpivoted_data     AS
         SELECT     person_seq_id
         ,     bonus_amount
         ,     currency_cd
         FROM     original_query
        UNION ALL
            SELECT  person_seq_id
         ,     0               AS bonus_amount
         ,     currency_cd_host     AS currency_cd
         FROM     original_query
    SELECT       person_seq_id
    ,       SUM (bonus_amount)          AS total_bonus_amount
    ,       COUNT (DISTINCT currency_cd)     AS distinct_currency_cds
    FROM       unpivoted_data
    GROUP BY  person_seq_id
    ;There may be a shorter, more efficient way to get the same results, but without knowing more about your tables, I can't tell.
    The tricky thing is getting two columns (currency_cd and currencuy_cd_host in this case) counted together. You can't simply say
    COUNT (DISTINCT eb.currency_cd) +
    COUNT (DISTINCT ed.currency_code_host)That happens to get the correct result with the sample data you posted, but what if you had data like thEe following?
    currency_cd     currency_cd_host
    INR          USD
    USD          INRHere, the count of distinct currency_cds is 2, and the count of distinct currency_cd_hsots is also 2. Does that mean the grand total is 2 + 2 = 4? No, the 2 codes in one column arte the same 2 codes as in the other column. We need to get both currency_cd and currency_cd_hsot into the same column, and then do COUNT (DISTINCT ...) on that combined column. A UNION, as shown above, will certainly do that, starting with your query as you posted it. The query you posted isn't necessarily the best frist step towards this result, however, so there may be a much better approach, depending on your tables.
    Edited by: Frank Kulash on Feb 1, 2012 6:21 PM
    Here's a slightly shorter, and probably more efficient way to get the same results:
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= 2
    SELECT       eb.person_seq_id
    ,       SUM (eb.bonus_amount)          AS total-amount
    ,       COUNT ( DISTINCT CASE
                        WHEN  c.n = 1
                        THEN  eb.currency_cd
                        ELSE  ed.currency_cd_host
                      END
              )               AS distinct_currency_cds
    FROM       fr_emp_bonuses    eb
    ,       fr_emp_details    ed
    ,       fr_periods          p
    ,       cntr              c
    WHERE        eb.person_seq_id  = ed.person_seq_id
    AND        ed.period_seq_id  = eb.period_seq_id
    AND        ed.period_seq_id  = p.period_seq_id
    AND        p.period_status   = 'CURRENT'
    AND        eb.bonus_amount   >= 0
    AND       eb.person_seq_i   = 3525125
    --       NOTE: no join condition involving c; we really do want a cross-join
    GROUP BY  eb.person_seq_id
    ;

  • Filename seperately & Putting data from Hash Map to two different columns

    The following code produces the output as :
    $ java getNamefile
    File Name : reaper.txt
    File Name : Testing
    Is it possible to just get the file name "reaper" from it instead of reaper.txt
    import java.io.*;
    class getNamefile
         public static void main(String[] args)
              File f1 = new File("C:/javamyprograms/reaper.txt");
              File f2 = new File("C:/javamyprograms/Testing/");
              System.out.println("File Name : " + f1.getName());
              System.out.println("File Name : " + f2.getName());
    }Secondly I am trying to put the values from a HashMap into ".xls"
    PrintWriter out = new PrintWriter (new FileWriter("Unique_words_count" + file) + ".xls");
    and out.write(key + " " + hm.get(key));
    This put the values in the same columns. I want the results to be two different columns like
    column1 column2
    key1 value1
    key2 value2
    Please do advise. Thanks in advance.

    Is it possible to just get the file name "reaper"from it instead of reaper.txtActually, I ran a test, and
         System.out.println(  "file name portion == " + ( f.getName().split( "\\." ) )[ 0 ] );works also:
    This has the same effect as:
         String fileName = f.getName();
         String splitFileName[] = fileName.split( "\\." );
         System.out.println(  "file name portion == " + splitFileName[ 0 ] );Now that I think about it, the second form is more easily understood. There is really no reason to do it the first way. Just interesting to note that you can.

  • I have 2 copies of Firefox open (two different windows with lots of tabs), if I reboot can I restore both sessions?

    I have 2 copies of Firefox open (two different windows with lots of tabs), if I reboot can I restore both sessions? I am familiar with clicking history/ restore previous session, but don't want to reboot to let windows update to do it's thing unless I can restore both sessions.

    If they are running different profiles, then yes.

  • Display two Different reports together

    Hi Experts,
    Is there any way that I can display two different  reports simultaneously/together in Web Portal
    Thanks in advance.

    Hi Manpreet,
    Although we can easily perform this in WAD , but as you asked the other option which requires some coding .
    Check the below thread for the same :
    how to display two lables in alv report
    Hope it helps,
    Supriya

  • Two different document types in MIRO

    Hi Gurus,
    Can we have two different FI document types in MIRO for Service PO and Normal PO?
    Standard is RE but we want one more.
    Can you please suggest something?
    Regards,

    You can work with your own document types but I do not hink you can have two different document types for Standard and Service PO.
    The effect of MIRO is still the same whether its Service PO or Standard PO - GR/IR debit and Vendor credit.
    If it is just for reporting, you can always take the PO number from RSEG table.Then drill down to EKKO/EKPO and get all the details.

  • How can I get these two results in two different columns?

    SELECT COUNT(attr_id)
    FROM pv_attribute
    WHERE port_id = 322;
    SELECT COUNT(attr_id)
    FROM pv_attribute
    WHERE port_id = 323;
    How can I get these two results in two different columns?
    Thanks

    So Jens made a tiny mistake with the column name... shame you couldn't be bothered to research Pivoting so you could have corrected the mistake (possibly it was deliberate *{:-) ) and learnt something.
    with pv_attribute as (select 16123 attr_id, 322 port_id from dual union all
                          select 16123 attr_id, 322 port_id from dual union all
                          select 19223 attr_id, 322 port_id from dual union all
                          select 11193 attr_id, 323 port_id from dual union all
                          select 13163 attr_id, 323 port_id from dual)
    -- end of test data setup
    select sum(decode(port_id, 322, 1, 0)) cnt_322,
           sum(decode(port_id, 323, 1, 0)) cnt_323
    from   pv_attribute
    where  port_id in (322, 323)

  • 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

  • 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 display two different parts of one image in two windows?

    hi everyone:) i need to display two different parts of one image in two windows. i have problem with displaying :/ because after creating windows there aren't any images :( i supose my initialization code of creating windows is incomplete, maybe i miss something or maybe there is some inconistency. graphics in java is not my strong position. complete code is below. can anybody help me?
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.swing.*;
    import java.util.*;
    class ImgFrame extends JFrame
           private BufferedImage img;
           ImgFrame(BufferedImage B_Img, int x, int y, int w, int h)
                   super("d");
                   img=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
                   img=B_Img.getSubimage(x, y, w, h);
           }//end ImgFrame construction
           public void paint(Graphics g)
                   Graphics2D g2D = (Graphics2D)g;
                   g.drawImage(img, 8, 8, null);
           }//end paint method
           public Dimension getPrefferedSize()
                   if(img==null)
                           return(new Dimension(100,100));
                   else
                           return(new Dimension(img.getWidth(null),img.getHeight(null)));
           }//end of GetPrefferedSize method
    }//end ImgFrame class
    public class TestGraph2D_03 extends Component
           static BufferedImage IMG;
           public static void Load()
                   try
                           IMG=ImageIO.read(new File("c:/test.bmp"));
                   catch(IOException ioe)
                           System.out.println("an exception: "+ioe);
                   }//end try catch
           }//end TestGraph2D_03 construction
           public static void main(String[] args)
                   Load();
                   ImgFrame F1 = new ImgFrame(IMG, 0, 0, 8, 8);
                   ImgFrame F2 = new ImgFrame(IMG, 8, 8, 8, 8);
                   F1.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F1.pack();
                   F1.setVisible(true);
                   F2.addWindowListener(new WindowAdapter()
                           public void windowClosing(WindowEvent e)
                                   System.exit(0);
                   F2.pack();
                   F2.setVisible(true);
           }//end of main method in TestGraph2D_01 class
    }//end of TestGraph2D_03 class

    Never override the paint(...) method of a Swing component.
    If you have a sub image then add the image to a JLabel and add the label to the GUI. No need for custom painting.

  • Sum two different columns from two different tables

    Can you select and sum two different columns, from two different tables in the same sql statement?
    i.e.
    table1
    Item----OnHand_Qty
    A--------10
    A--------15
    B--------10
    B--------10
    C--------20
    table2
    Item----Trx_Qty
    A--------2
    A--------4
    A--------6
    B--------1
    B--------1
    C--------4
    I'm looking for the following results from a query
    Item----Sum(Onhand_Qty)---Sum(Trx_Qty)
    A--------25

    Like this?
    SQL> create table table1 (item,onhand_qty)
      2  as
      3  select 'A', 10 from dual union all
      4  select 'A', 15 from dual union all
      5  select 'B', 10 from dual union all
      6  select 'B', 10 from dual union all
      7  select 'C', 20 from dual union all
      8  select 'D', 30 from dual
      9  /
    Tabel is aangemaakt.
    SQL> create table table2 (item, trx_qty)
      2  as
      3  select 'A', 2 from dual union all
      4  select 'A', 4 from dual union all
      5  select 'A', 6 from dual union all
      6  select 'B', 1 from dual union all
      7  select 'B', 1 from dual union all
      8  select 'C', 4 from dual union all
      9  select 'E', 3 from dual
    10  /
    Tabel is aangemaakt.
    SQL> select nvl(t1.item,t2.item) item
      2       , t1.sum_onhand_qty
      3       , t2.sum_trx_qty
      4    from ( select item, sum(onhand_qty) sum_onhand_qty
      5             from table1
      6            group by item
      7         ) t1
      8         full outer join
      9         ( select item, sum(trx_qty) sum_trx_qty
    10             from table2
    11            group by item
    12         ) t2
    13         on (t1.item = t2.item)
    14  /
    I SUM_ONHAND_QTY SUM_TRX_QTY
    A             25          12
    B             20           2
    C             20           4
    E                          3
    D             30
    5 rijen zijn geselecteerd.Regards,
    Rob.

Maybe you are looking for