By comparing the values in the same column

Hello

I have a requirement to do the following:

The guest of the dashboard has two drop downs as 'Acct number 1' and others as 'Acct number 2 ". Both are the same column from the database. When two different values are chosen from the prompt, it should produce a report with the following 5 colomns, 'ACCT1', 'SALES AMOUNT ACCT1', "ACCT2", "SALES AMOUNT ACCT2", "DIFFERENCE".

I tried to use a variable of presentation in the command prompt and it fills my column pther having the same value I have input for the first prompt.

How can I do this? Thanks for your time and your help.

Hello

You can try it at the level of the report.

* Ensure that you have set your guests with different effects. Suppose that the two PVs are acc1 and acc2.
* Report, add below filter
Account number is equal to @{acc1} {defualtvalue}
OR
Account number is equal to @{acc2} {defualtvalue}
This will filter the report by the two account numbers.
* Now apply below in your fx of all columns.

"ACCT1: ' @{acc1} {defualtvalue}"
ACCT1 SALES AMOUNT: FILTER (with the HELP of SalesCol (AccountNumber = ' @{acc1} {defualtvalue}'))
"ACCT2: ' @{acc2} {defualtvalue}"
ACCT2 SALES AMOUNT: FILTER (with the HELP of SalesCol (AccountNumber = ' @{acc2} {defualtvalue}'))
DIFFERENCE: FILTER (with the HELP of SalesCol (AccountNumber = ' @{acc1} {defualtvalue}'))-FILTER (with the HELP of SalesCol (AccountNumber = ' @{acc2} {defualtvalue}'))

Thank you

Tags: Business Intelligence

Similar Questions

  • Multiple values for the same column in the columns of diffétent in the same row?

    Hi all
    I wonder how you can display different values for the same column in different columns on the same line. For example, using a CASE statement, I can:

    CASE WHEN CODE IN ('1 ', ' 3') THEN COUNT (ID) AS 'Y '.
    CASE WHEN CODE NOT IN ('1 ', am') THEN COUNT (ID) AS "N".

    Yes, that will produce two columns but will produce null values to empty and also two separate registers.


    Any ideas?

    Thank you

    Are you sure that this code works for you?

    Select ID
             ,CASE WHEN MODE_CODE IN ('1', '3') THEN COUNT( No) END as "Fulltime"
             ,CASE WHEN MODE_CODE NOT IN ('1', '3') THEN COUNT( No ) END  as "Other"
    From table
    group by ID
    

    I guess the code above fails because MODE_CODE is not in your group by?

    My suggestion would be to put the CASE in the COUNT:

    Select ID
             ,COUNT(CASE WHEN MODE_CODE IN ('1', '3') THEN No END) as "Fulltime"
             ,COUNT(CASE WHEN MODE_CODE NOT IN ('1', '3') THEN No END)  as "Other"
    From table
    group by ID
    

    CASE expressions return no. when the respective conditions are true and NULL otherwise.
    COUNTY will have non-null values.

  • Select literal values in the same column

    Hello
    like the practice:

    Select 'A', 'B', 'C' for double
    will select these values in their own column on the same line, is there a simple way to select these values in the same column on lines without first their insertion into a table?

    Thank you
    SQL> select 'A' x from dual union
      2  select 'B' x from dual union
      3  select 'C' x from dual ;
    
    X
    -
    A
    B
    C
    

    A bit complicated:

    SQL> select chr(ascii('A')+level-1) x
      2  from dual
      3  connect by level <=3;
    
    X
    -
    A
    B
    C
    

    Other:

    SQL> select regexp_substr('ABC','[[:alpha:]]',1,level) x
      2  from dual
      3  connect by level <= length('ABC');
    
    X
    ---
    A
    B
    C
    

    Max
    http://oracleitalia.WordPress.com

    Published by: Massimo Ruocchio, February 12, 2010 17:55
    added a second

    Published by: Massimo Ruocchio, February 12, 2010 17:58
    Added the third

  • By subtracting the values in the same column?

    Hello

    How can I subtract two values in the column of the table. EG - there is a table with two columns with date and cumulative turnover.

    Date Total_sales
    ===== =======
    February 23, 68
    24 feb-122
    25 feb-150
    26-Feb-200
    27 feb-223

    I need to know about the date that sales have been maximum. As we can see on 24 - Feb, sales were 54. We do this by subtracting 122-68.
    How can subtract us values in the same column?

    Thank you

    Take a look at the lag() of analytic SQL function which should give you what you need.

    See you soon,.
    Harry

  • an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    an alphabet by typing in a cell gives drop down suggestions from previous hits on the same column. But how the drop down to choose the suggestions of the other columns and other sheets.

    Hi mdsavol,

    Your observations are accurate. The 'suggestions' are previous entries in the same column that correspond to what has been entered so far in the active cell. The only direct user control is to activate the function turn on or off in numbers preferences > general.

    There are other ways to include or exclude items of suggestions:

    • To remove typos in the suggestions list, the user must correct the typos in the cell above the active cell. If they are more in the list, they won't be presented as suggestions.
    • To include selections added to the list, the user must enter these suggestions in the individual cells above the active cell and column where they are wanted as suggestions.

    There was a request here a while there is a list of suggestion 'live' similar to those of some websites, which offers a descending list of possible entries as a type in an input box.

    The only way I see to reach a solution similar to what you have asked is to use as many lines at the top of the non-en-tete of the table section to list the items likely to repeat in your table, and then hide the lines. You'll need a list for each column where you want to use this feature with a list previously planted. Existing items will then require a likely hit up to three, then a click to choose from a list small enough to enter a value into a cell. News he will need to enter in full the first time, but after that it will be put on the list and answer the same thing as the terms preseeded.

    While your setting upward (or decide not to do), consider going on the menu of number (in numbers), choosing to provide feedback from numbers and writing a feature in Apple request. Describe what you want. Explain how he could help the average user numbers, and then hope for the best.

    Kind regards

    Barry

  • Entries are concatenated in the same column in the excel file

    Hi, I really need help in this emergency. The problem is when I open the spreadsheet file after you run the program below, all the values that I believe are concatenated in the same column. However, there are 2 different analog inputs which I want in 2 different columns. I'm getting the 2 waveforms in the same graph, but when I open the excel file, it seems that the entries are concatenated in the same column. Someone knows how to fix this? Thank you very much.

    Hi Ben 64,.

    Thanks a lot again. I did as you said and I removed the dynamic data and logged files added directly to the results. I'm still checking if the program works as I can branch only when I return to work tomorrow. Tell me if you think it might be able to work this time. Thanks a lot again!

  • Two or more SRID in the same column?

    Hello, I am working with Oracle Spatial, and I have a problem with the SRID.

    I have a column in a table with the SDO_GEOMETRY type and I need to create a Spatial Index to use. But to create a Spatial Index first, I need to insert metadata into the table incluied SRID: for example

    Insert in user_sdo_geom_metadata (table_name, column_name, srid, diminfo) values ('Spatial_Test', 'GEOMETRIA', 8307, SDO_DIM_ARRAY (SDO_DIM_ELEMENT('LONGITUDE',-180,180,0.5), SDO_DIM_ELEMENT ('LATITUDE',-90, 90, 0.5)));

    But I need to work with more than one SRID in this column. Is there anyway to have two or more SRID in the same column? How? and if I insert them, can they give any problem?

    Thank you very much.

    Good bye.

    ZeyKa,

    . . . . You can transform and store all your geometries in SRID 8307 and then turn to their original SRID when you SELECT them.

    -- "Example: Transform geometry from  to SRID 8307 for storage"
    -- "NOTE: Replace  and  with your values"
    INSERT INTO MyTable (ID, geometry,RenderSRID) VALUES (1, SDO_CS.TRANSFORM(,8307), );
    
    -- "Example: Transform stored geometry back to its "
    SELECT SDO_CS.TRANSFORM(geometry,RenderSRID) FROM MyTable WHERE ID = 1;
    

    Kind regards
    Noel

  • Two guests on the same column

    Hi Experts,

    I'm defining two different guests (and associate them with the two variables of different presentation) on the same column. However, when I view the 2 guests on the same dashboard page, whenever I select a value for the first prompt, the same value is automatically selected for the second line.

    Is this a normal behavior? How to capture the two distinct values?

    Thank you
    Guillaume

    Hi William,.

    I think I forgot something.

    You must do the following steps:

    (1) add the column to the dashboard command prompt.
    (2) in the column "Show" change the option to 'results '.
    (3) in the column "Column" change the formula of the column to a name like «filter 1"»
    (4) this column value to the variable in the presentation, such as FILTER1.
    (5) change the label for the column.
    (6) assign the filter in your report to the presentation FILTER1 variable.

    Repeat step 1 to 6 for the second filter.

    Kind regards
    Stijn

  • A target table is in charge of two different sources but the same columns, but a source is one database and another in a flat file.

    We all hope you are doing well.

    I have a business problem to implement in ODI 11 G. It's here. I'm trying to load a target table from two sources that have the same column names. But a source is to the file format and the other is in the Oracle database.

    That's what I think I'll create two mappings in the same interface by using the Union between the sources. But I don't know how the interface would connect to different logical architecture to connect to two different sources.

    Thank you

    SM

    You are on the right track, all in a single interface. Follow these steps

    (1) pull model of your data in the designer of the source file and your table model target to the target pane.

    (2) all relevant columns map

    (3) in the source designer to create a new dataset and choose as the UNION join type (this will create a separate tab in the source designer pane)

    (4) select the new dataset tab in the source designer pane and pull your source oracle table data model in the designer of the source. All columns that are relevant to the target card

    (5) make sure that your staging location is set to a relational technology i.e. in this case the target would be an ideal candidate because it is where the ODI will organize the data from source two files and oracle and perform the UNION before loading to the target

    If you want to watch some pretty screenshots showing the steps above, take a look at http://odiexperts.com/11g-oracle-data-integrator-part-611g-union-minus-intersect/

  • Multiple constraints on the same column

    Hello experts, we can use Multiple forced on the same column in oracle as creating table, I want to add a key single and forced to check on the same column is this possible? Thanks in advance,

    If you want, seems to be possible

    CREATE TABLE t1

    (col1 VARCHAR2 (50))

    CONSTRAINT ck1 CHECK (col1 IN ('A', 'B', 'C'))

    CONSTRAINT PRIMARY KEY (col1) pk1

    );

  • Compare the same value of the column

    Hello
    I have table as below
    ID      Date     Department
    1   25-Jul-08        XX
    2   26-Jul-08        XX
    3   22-May-08        YY
    4   23-May-08        YY
    5   24-May-08        YY
    6   13-Jun-08        ZZ
    7   14-Jun-08        ZZ
    Now, I need to compare the date of each Department and return the case to higher-value Date only in this Department. my result set must therefore as below:
    ID      Date     Department
    2   26-Jul-08        XX   
    5   24-May-08        YY
    7   14-Jun-08        ZZ
    any idea?

    Is only one record in the Department with the highest date?
    If so, use aggregate KEEP statement:

    SELECT max (id) to Dungeon code (dense_rank of first order of date # desc).
    Max(date#), Department of
    Of

    Group of Department;

    If several whan a line with the date of the highest can exist in a single Department, use

    SELECT id, date #, Department
    de)
    SELECT id, date #, Department, dense_rank() on Dr. (depatyment date order partition # desc)
    Of


    )
    where dr = 1

    (Not tested!)

    Rgds.

  • Comparing the same outer join column.

    Hello

    I have the following query.
    SELECT Replens.Date1               AS date1,
      Replens.USER_ID                  AS Operator1,
      Picks.USER_ID                    AS Operator1,
      Users.Time                       AS Logged_in_hours,
      Replens.Quantity                 AS Pallet_replened,
      SUM(Replens.Quantity/Users.Time) AS Replen_rate,
      Picks.Quantity                   AS Cases_picked,
      SUM(Picks.Quantity/Users.Time)   AS Pick_rate
    FROM
      (SELECT libclientreports.getshift(itl.dstamp) Date1,
        ITL.USER_ID,
        COUNT(ITL.tag_id) Quantity
      FROM INVENTORY_TRANSACTION ITL
      WHERE ITL.code                                     = 'Replenish'
      AND TO_CHAR(itl.dstamp, 'DD-Mon-YYYY HH24:MI:SS') >= '01-Mar-2010 06:00:00'
      AND TO_CHAR(itl.dstamp, 'DD-Mon-YYYY HH24:MI:SS') <= '01-Mar-2010 18:00:00'
      GROUP BY libclientreports.getshift(itl.dstamp),
        ITL.USER_ID
      ORDER BY ITL.USER_ID,
        libclientreports.getshift(itl.dstamp)
      ) Replens,
      (SELECT libclientreports.getshift(itl.dstamp) Date1,
        ITL.USER_ID,
        SUM(ITL.update_qty) Quantity
      FROM INVENTORY_TRANSACTION ITL
      WHERE ITL.to_loc_id                                = 'CONTAINER'
      AND TO_CHAR(itl.dstamp, 'DD-Mon-YYYY HH24:MI:SS') >= '01-Mar-2010 06:00:00'
      AND TO_CHAR(itl.dstamp, 'DD-Mon-YYYY HH24:MI:SS') <= '01-Mar-2010 18:00:00'
      GROUP BY libclientreports.getshift(itl.dstamp),
        ITL.USER_ID
      ORDER BY ITL.USER_ID,
        libclientreports.getshift(itl.dstamp)
      ) Picks,
      (SELECT USER_ID,
        SUM(LibClientReports.getLoggedInHours (USER_ID, to_date('01-Mar-2010 06:00:00', 'DD-Mon-YYYY HH24:MI:SS'), to_date('01-Mar-2010 18:00:00', 'DD-Mon-YYYY HH24:MI:SS')) )/60 TIME
      FROM APPLICATION_USER
      GROUP BY USER_ID
      ) Users
    WHERE Users.Time != '0'
    AND Users.USER_ID = Picks.USER_ID (+)
    AND Users.USER_ID = Replens.USER_ID (+)
    GROUP BY Replens.Date1,
      Replens.USER_ID,
      Picks.USER_ID,
      Users.Time,
      Picks.Quantity,
      Replens.Quantity
    ORDER BY Replens.USER_ID,
      Replens.Date1
    The problem I have is with the operator1 columns, I've done outer joins on the Users table that contains all users that will be returned in the tables of the peaks and Replens.
    However, I want to merge this operator1 into one column. For example, here is the current data, I have for the two columns of the operator 1;
    Operator1       Operator1_1
    
    D9AGY19             D9AGY19
    D9BEELB             D9BEELB
    D9FULOPS     (null)
    D9GAWKOWA     D9GAWKOWA
    D9LIDDING     D9LIDDING
    D9NOWAKS     D9NOWAKS
    (null)             D9AGY10
    (null)             D9AGY13
    (null)             D9AGY15
    (null)             D9AGY17
    And here is the data I want to see;
    Operator1
    
    D9AGY19
    D9BEELB
    D9FULOPS
    D9GAWKOWA
    D9LIDDING
    D9NOWAKS
    D9AGY10
    D9AGY13
    D9AGY15
    D9AGY17
    Notice the USER_ID to replace the values (null).

    Could someone please explain to me how to make this happen? If you want more information please let me know.


    Kind regards

    SM.

    This should do if Op1 and Op1_1 are always the same or one or the other is null. If both are filled and have different values, then it will not work:

    nvl(Replens.USER_ID, Picks.User_ID) as                  AS Operator1
    
  • All unique combinations of values in the same column of a group?

    Hi friends

    I have a table t with data as follows
    CREATE TABLE T
    (order_number number,
    item_name varchar2(3))
     
    INSERT INTO T VALUES (1,'A1');
    INSERT INTO T VALUES (1,'A2');
    INSERT INTO T VALUES (1,'B1');
    INSERT INTO T VALUES (1,'B2');
    INSERT INTO T VALUES (1,'C1');
    INSERT INTO T VALUES (1,'C2');
    INSERT INTO T VALUES (2,'A4');
    INSERT INTO T VALUES (2,'B1');
    INSERT INTO T VALUES (2,'A3');
    INSERT INTO T VALUES (2,'B5');
    INSERT INTO T VALUES (2,'C1');
    INSERT INTO T VALUES (2,'C2');
    
    sql> SELECT ITEM_NAME, ORDER_NUMBER FROM T
    /
    
    
    item name   order number
    A1             1
    A2             1
    B1             1
    B2             1
    C1             1
    C2             1
    ...
    ...
    A4             2
    B1             2
    A3             2
    B5             2
    C1             2
    C2             2
    
    In my table, each 'item' can appear just once in each 'order number'. 
    I want to join each item name to all other item names (without any repitition), within the same order number. 
    
    
    My desired output is like below:
    
    item name     item name   order number
    A1            A2          1
    A1            B1          1
    A1            B2          1
    A1            C1          1
    A1            C2          1
    A2            B1          1    
    A2            B2          1
    A2            C1          1
    A2            C2          1
    B1            B2          1    
    B1            C1          1
    B1            C2          1
    B2            C1          1
    B2            C2          1
    C1            C2          1    
    
    ......
    ......
    ......
    There are 15 combinations so the number 1
    .. .nCr where n = 6 and r = 2 NCR Yes = 15.


    Note: x A1 A2 is ignored because already, A1, A2 came in the first row of my desired output. similar cases for others combinations should be ignored as well.


    I want to have the shortest possible of a query with more rapid execution to achieve this goal. Because in my real table 2000 there order numbers and each order number has 10 unique objects.

    I look forward to the answer.

    concerning
    Hamza

    Published by: Hamza on July 10, 2011 22:55

    Published by: Hamza on July 10, 2011 22:58
    with t as (
               select 'A1' item_name,1 order_number from dual union all
               select 'A2',1 from dual union all
               select 'B1',1 from dual union all
               select 'B2',1 from dual union all
               select 'C1',1 from dual union all
               select 'C2',1 from dual
              )
    -- end of on-the-fly data sample
    select  t1.item_name,
            t2.item_name,
            t1.order_number
      from  t t1,
            t t2
      where t1.order_number = t2.order_number
        and t1.item_name < t2.item_name
      order by t1.order_number,
               t1.item_name,
               t2.item_name
    /
    
    ITEM_NAME  ITEM_NAME  ORDER_NUMBER
    ---------- ---------- ------------
    A1         A2                    1
    A1         B1                    1
    A1         B2                    1
    A1         C1                    1
    A1         C2                    1
    A2         B1                    1
    A2         B2                    1
    A2         C1                    1
    A2         C2                    1
    B1         B2                    1
    B1         C1                    1
    
    ITEM_NAME  ITEM_NAME  ORDER_NUMBER
    ---------- ---------- ------------
    B1         C2                    1
    B2         C1                    1
    B2         C2                    1
    C1         C2                    1
    
    15 rows selected.
    
    SQL> 
    

    SY.
    P.S. It your order_number big enough index table, nom_element would be useful.

  • How to compare the unique column values

    Hi all

    I have data in following manner

    PAT_ID PAT_ENC_CSN_ID DEPT_ID EFFECTIVE_DATE

    Z369160557291136405500122 APRIL 14
    Z369160557291136405500222 APRIL 14
    Z269466457982980405500116 MAY 14
    Z269466457982980405500216 MAY 14
    Z268924357987777405500116 MAY 14
    Z268924357987777405500218 MAY 14

    My requirement is to know if the patient changes in another Department at the same time, so I need to select the patient or even dismiss the patient. In my example above, I have to select Z3691605 and Z2694664 patients and ignore the remaining patient.

    Can someone plase help me with the code for that sql. I use 11g.

    Hope I have my question clearly.

    Thank you.

    Here is a way use are:

    SQL > select *.

    2 t a

    3 where exists (select 1

    4t b

    5 where a.pat_id = b.pat_id

    6 and a.pat_enc_csn_id = b.pat_enc_csn_id

    7 and a.effective_date = b.effective_date

    8 and a.dept_id <> b.dept_id

    9                );

    PAT_ID PAT_ENC_CSN_ID DEPT_ID EFFECTIVE_DATE

    ------------------------------ -------------------- -------------------- --------------------

    Z3691605 57291136 4055002 22 APRIL 2014 00:00:00

    Z3691605 57291136 4055001 22 APRIL 2014 00:00:00

    Z2694664 57982980 4055002 16 MAY 2014 00:00:00

    Z2694664 57982980 4055001 16 MAY 2014 00:00:00

  • How to make the comparison operation in the same column

    Hello

    here to fix vi I want to make the comparison of the 3rd column operation.

    I tried with different ways, but I didn't want to result.

    Please guide me how to compare the column value with the previous measured all 3rd.

    I want to compare the current value with the previous value, and if the current value is less, one of the previous then LED must be OFF.

    Thank you very much.

    Same basic idea, but less code...

Maybe you are looking for

  • Satellite a60-106 does not recognise handycam

    HelloI got my satellite for about a month and everything works fine but when I try to transfer video to my handycam I get an error on the screen of the camera saying "usb invalid during easy handycam" sony's site is all the answers. Other usb devices

  • Mini Strip HD Digital Sony 63

    Will someone kindly advise me regarding Sony 63 Mini Digital HD Tape? Recently, I recorded a six minutespart of the band and a few days after I recorded the residual balance of the band...A few days later, I captured the content of the entire band us

  • HP ENVY 4500 Series (network): scan negatives

    I have the HP ENVY Series 4500 (network) printer/scanner/fax machine and would like to know if it is possible to scan 35 mm negatives and save them as a digital file on my PC?

  • Rise of Nations Windows 7 problems

    I just bought a new PC with windows 7 (64bt) and no problem with installation of Rise of nations. It works well, but my mouse is not displayed on the screen. The menus emphasize that if the mouse works but the ingame mouse icon does not move from the

  • Body of the email will not come through in Outlook Express

    We had 2 accounts in Outlook Express for several years.  Our accounts are set up exactly the same.  The second ACCT. -the body of the emails will come through.  You cannot compose mail or answering emails.  Nothing has changed.  Is there a solution.