cases when for several columns

Hello, Experts

Could help me please on the function below. ?

How to call two different columns in the instruction box.

I'm migrating some of the BO decode OBIEE11g reports to help can we able to reach below senario in BO-universe but I don't know how we can achieve this in RPD - OBIEE 11 g

DECODE (TABLE.NAME_1. Column_name, 'Client Meeting passwords', TABLE_NAME2. COLUMN, NULL)

Concerning

Sri

Thanks for the reply Ceresa... !

I use Case when statement... but I could not able to include more than one Table_Name.Coulmn_Name. the RPD

For Ex in BO_Universe, it's logic has been used: DECODE (RPT.CUST_INFO.INFO_SUBTYPE,'Customer has past, RPT.) CUST_INFO. BODY, NULL)

OBIEE: I'm trying to use like this: case when RPT.CUST_INFO.INFO_SUBTYPE,'Customer has past AND the RPT words. CUST_INFO. BODY = "NULL") END.

ERROR: [nQSError: 27002] near <=>: syntax error [nQSError: 26012].

Please guide me I missed something in the formula... ?

I thank in advance. !

Sri

Tags: Business Intelligence

Similar Questions

  • unique index for several columns

    Hi all

    We have a requirement for our application, to add a single search box, which searches more than 1 table of different columns. The way in which we have now implemented, is the following (simplified example):
    Select *.
    WCP
    where instr(ename,:SEARCH) > 0
    or instr(job,:SEARCH) > 0
    or...

    This approach is relatively slow, of course. I want to change it, using the text of the Oracle. Can you give me advice what kind of index, must be used? Our requirement:
    -index must continue to be up-to-date (a few seconds)
    -research must be
    -case insensitive preference
    -number of columns to be indexed: aprox. 20 in a table

    I heard once you can make a function, with all the columns you want to index. This function generates an xml document, and you can use this function to create an Oracle text index. However, I can't seem to find how I can implement that. Or is there a better aproach?

    Thanks again for your help!

    You can use a multi_column_datastore, that generates xml documents as you describe in the scenes. You can also use the transactional option or sync (on validation) with optimization. See the simplified example with only two columns below that matches what you provided. You can find further information and examples for the multi_column_datastore in the online documentation.

    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('emp_ds', 'multi_column_datastore');
      3    ctx_ddl.set_attribute ('emp_ds', 'columns', 'ename, job');
      4  end;
      5  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> alter table emp add (any_column varchar2(1))
      2  /
    
    Table altered.
    
    SCOTT@orcl_11gR2> create index emp_idx
      2  on emp (any_column)
      3  indextype is ctxsys.context
      4  parameters
      5    ('datastore emp_ds
      6        transactional')
      7  /
    
    Index created.
    
    SCOTT@orcl_11gR2> variable search varchar2(100)
    SCOTT@orcl_11gR2> exec :search := 'CLARK'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> select ename, job from emp
      2  where  contains (any_column, :search) > 0
      3  /
    
    ENAME      JOB
    ---------- ---------
    CLARK      MANAGER
    
    1 row selected.
    
    SCOTT@orcl_11gR2> exec :search := 'CLERK'
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> select ename, job from emp
      2  where  contains (any_column, :search) > 0
      3  /
    
    ENAME      JOB
    ---------- ---------
    SMITH      CLERK
    ADAMS      CLERK
    JAMES      CLERK
    MILLER     CLERK
    
    4 rows selected.
    
  • How to get the checksum for several columns?

    I need to compare the data of a record in a data table in another table. The structures of the two tables are not the same, but the data types of the columns I'm comparing cam is obviously the same. There are many columns so I thought that a shortcut to make a crazy long A = A AND B = B, etc... several dozens of times to check if the data are different each time was to use checksum.

    I had planned to use the concatenation of all the columns together in a single string, delmitted by a semicolon.

    However, I find that it does not work as desired. The checksum produces the same number for different values of data. So I need ot use something else.

    There is another function I could use in a similar way where it will create a compact, unique hash to a concatenated string of time I spend?

    And what is the data type of the return value - hoping that it's digital!

    What checksum algorithm do you use?

    Depending on the version of Oracle, you can use the HASH of the package DBMS_CRYPTO method, i.e.

    SELECT dbms_crypto.hash( to_clob( ename || empno || sal ),
                           1 /* dbms_crypto.hash_md4 */ )
      FROM emp
    

    A MD4 hash should have a very low incidence of collisions of normal data even if it isn't particularly cryptographically course. You can also use the ORA_HASH method

    SELECT ora_hash( ename || empno || sal )
      FROM emp
    

    but I expect the chance of collisions to be a little higher.

    Justin

  • Using the account with pivot for several columns

    create table TEST_CASETBL (ID, NUM, TYPE, CREATED_BY, CREATED_DT) that choose

    1, 1-1, CO, ABC, sysdate-10 of all the DOUBLE select union

    2, 1-1, EO, ABC, sysdate-10 of all the DOUBLE select union

    3, 1-2, CO, ABC, sysdate-10 of all the DOUBLE select union

    4, 1-2, UPD, ABC, sysdate-10 of all the DOUBLE select union

    5, 1-3, CO, XYZ, sysdate-10 of all the DOUBLE select union

    6, 1-3, EO, XYZ, sysdate-10 of all the DOUBLE select union

    7, 1-4, CO, XYZ, sysdate-10 of all the DOUBLE select union

    8, 1-4, NT, XYZ, sysdate-10 of all the DOUBLE select union

    9, 1-5, EO, XYZ, sysdate-10 of all the DOUBLE select union

    10, 1-5, NT, XYZ, 10 sysdate from DUAL;

    I want to calculate number of NUM, County of different values in the 'TYPE' column based on the CREATED_BY column

    Expected result:

    CREATED_BY Count (NUM) Count (CO) Count (EO) Count (s) Count (UPD)

    ABC                                 2(which means 1-1,1-2)               2                   1                         0            1

    XYZ                           3(which means 1-3,1-4,1-5)               2                    2                        2            0

    Please provide your suggestions to solve the SQL query form

    Thank you

    Hello

    Melissacharlier-Oracle wrote:

    create table TEST_CASETBL (ID, NUM, TYPE, CREATED_BY, CREATED_DT) that choose

    1, 1-1, CO, ABC, sysdate-10 of all the DOUBLE select union

    2, 1-1, EO, ABC, sysdate-10 of all the DOUBLE select union

    3, 1-2, CO, ABC, sysdate-10 of all the DOUBLE select union

    4, 1-2, UPD, ABC, sysdate-10 of all the DOUBLE select union

    5, 1-3, CO, XYZ, sysdate-10 of all the DOUBLE select union

    6, 1-3, EO, XYZ, sysdate-10 of all the DOUBLE select union

    7, 1-4, CO, XYZ, sysdate-10 of all the DOUBLE select union

    8, 1-4, NT, XYZ, sysdate-10 of all the DOUBLE select union

    9, 1-5, EO, XYZ, sysdate-10 of all the DOUBLE select union

    10, 1-5, NT, XYZ, 10 sysdate from DUAL;

    I want to calculate number of NUM, County of different values in the 'TYPE' column based on the CREATED_BY column

    Expected result:

    CREATED_BY Count (NUM) Count (CO) Count (EO) Count (s) Count (UPD)

    ABC                                 2(which means 1-1,1-2)               2                   1                         0            1

    XYZ                           3(which means 1-3,1-4,1-5)               2                    2                        2            0

    Please provide your suggestions to solve the SQL query form

    Thank you

    This CREATE TABLE statement works when try you it?  Do you need single quotes around string literals?

    You may want something like:

    WITH data_to_pivot AS

    (

    SELECT created_by, type

    COUNT (DISTINCT num) over (PARTITION BY created_by) AS count_num

    OF test_casetbl

    )

    SELECT *.

    OF data_to_pivot

    PIVOT (COUNT (*)

    TO indicate the ("CO" AS count_co

    'EO' AS count_eo

    'NT' AS count_nt

    'UPD' AS count_upd

    )

    )

    ORDER BY created_by

    ;

  • How to get a separate account of several columns

    I've done this before and I'll darn why I don't remember this.

    A table with 3 columns with the primary key defined in the column.

    Line a, b and c
    NUM.
    1 020 how abc
    2 why 030 def
    3 010 no IGS
    4 how 040 abc
    Yes def 5 050
    6 060 why def

    So what I want is a number of unique values to columns b and c as if b and c were in fact a field.

    So the result of the query:
    Count = 4 unique lines.

    I hope I make some kind of sense. It is a bit much to know if the number of occurrences of each duplicate value, I know not just get the number of unique lines of lines not indexed will be enough. Because the query is supposed to be universal for several digital and alphanumeric data columns and can be extended for several columns, I'm just trying to get a basic skeleton which works for an analysis "on the fly".

    It will be useful.

    SQL>create table rb as select rownum A, rownum b , rownum c from dual connect by level < 11;
    
    Table created.
    
    Elapsed: 00:00:00.31
    SQL>select count(distinct a) from Rb
      2  union all
      3  select count(distinct B ) from Rb
      4  union all
      5  select count(distinct c) from Rb
      6  /
    
    COUNT(DISTINCTA)
    ----------------
                  10
                  10
                  10
    
    Elapsed: 00:00:00.53
    SQL>update rb set b = 3 where B > 5;
    
    5 rows updated.
    
    Elapsed: 00:00:00.26
    SQL>commit;
    
    Commit complete.
    
    Elapsed: 00:00:00.26
    SQL>select count(distinct a) from Rb
      2   union all
      3   select count(distinct B ) from Rb
      4   union all
      5   select count(distinct c) from Rb
      6   /
    
    COUNT(DISTINCTA)
    ----------------
                  10
                   5
                  10
    
    Elapsed: 00:00:00.53
    SQL>
    
  • When I try to open CompuServe, which I used for several years on Firefox, a screen appears saying: this isn't a trusted site and it wont let me.

    When I try to open CompuServe, which I used for several years on Firefox, a screen appears saying: this isn't a trusted site and it wont let me.
    Here's what's on the screen that appears when I try to open CompuServe and AOL CompuServe of owner:
    ___________________________________________________________
    This connection is Untrusted
    You asked Firefox to connect safely to my.screenname.aol.com, but we cannot confirm that your connection is secure.
    Normally, when you try to connect safely, sites will present a reliable identification to prove that you're in the right place. However, the identity of this site cannot be verified.
    _____________________________________________________________

    There was a security of Firefox auto update on Friday, August 7, 2015 after which this problem started to occur. On my other computer, I use very often and on which I also use Firefox, I can easily open CompuServe.

    You allowed the information to be included in the details of your system more when you posted. Look to the right of your original post, where it is said more details of the system.

  • Since the update Firefox 6.0, some websites do not load correctly. I suspect it has to do with the Java being disabled because of the compatability modules. When I try to go to Tools/Add-ons, I get the message "Loading" for several minutes without chang

    Update Firefox 6.0 is useless to me because many websites I visit are not displayed properly, I guess because the Java modules are disabled because of incompatibility. They appear correctly in Internet Explorer.

    In addition, the add-on from Trend Micro is not compatible, which leaves me with a positive feeling.

    When I try to check to see if these modules can be updated, the menu item Tools/Addons just goes to a page with "loading" and stays there for several minutes without change until I close it.

    I would like to know the procedure to regularize this version of Firefox to my previous version that worked.

    Firefox 5.0/5.0.1/4.0/4.0.1 and earlier 3.6.20 all contain questions of security and stability that will not be corrected. You put your system at risk by using any version of Firefox that 6.0 or 3.6.20. Any person who displays a link to other versions is to be irresponsible, in my opinion.

    Java

    If the incompatible extensions in Add-ons > Extensions are Java Console, you have no need them unless your doing Java development. Most of the users have not yet installed, but Java will install Java Console with each update. You can delete them manually:

    The only thing that affects the functioning of the sites/Java applets on the web is the plugin (Add-ons - > Plugins) "Java (TM) Platform SE (version)". Do not forget that it is enabled and that you have not all extensions which affect/block "scripts".

    Trend Micro

    You must contact Trend Micro or go to the forums on their website to inquire about their plans to update the add-ons/toolbars they install in Firefox.

    Problem with the display of the Add-ons Manager

    The Add-ons Manager gets in a loop of loading due to the recent update of Firefox 6 and servers being overloaded because users and update process are looking for updates to the add-on. If you stay away from the "Get Add-ons" selection on the left of the screen of the add-on Manager, you should have no problem with that. This situation is expected to resolve when the overload of Firefox 6 update is complete. I do not always use this "Get Add-ons" option, instead, I go to the website of modules and the search for what I want from there: https://addons.mozilla.org/en-US/firefox/search/?q=clone & cat = all & x = 0 & y = 0

  • When I connect windows, the hard disk works for several minutes

    Hello

    A few months ago and after installing some windows update (XP Sp2), I see when I login to windows, drive hard work continuously for several minutes and speed goes down.

    What windows software using the hard disk with log in?

    Thanks in advance

    motasemsadelghi

    What you see could be linked to a task that you have schedules (such as anti-virus, defragmentation of the hard drive, etc)

    Check the tab startup in MSConfig for items which currently running as part of the startup of your PC. See

    http://support.Microsoft.com/kb/310560

    The foregoing is for XP, but also applies to Vista.

  • When Windows starts it is always a dialogue box that flashes on the screen and the CPU usage high (above 50%), after I connect sometimes for several minutes.

    Original title: at the start of Windows there is always a dialogue box that flashes on the screen, but I've known idea what it is.

    How can I determine which program is using this dialog box? I also don't expect high utilization of the processor (over 50%) after that I connect sometimes for several minutes. I see not all applications running in the Task Manager. The amount of CPU utilization in the services tab doesn't match what I see compared to what the gadget is read in my sidebar. Any ideas?

    Thanks in advance

    Hi Soan,

    1. What is exactly mentioned in the dialog box?

    2. when the problem started?

    3. did you of recent changes on the system?

    Method 1:

    Step 1:

    You can check if the problem occurs in safe mode.

    Start your computer in safe mode

    Step 2:

    If you are not faced with the question in safe mode, you can perform a clean boot and check.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please refer to clean the boot link to put the computer to normal startup mode.

    Method 2:

    You can read the following article and perform a full scan of security on your computer.

    Microsoft safety scanner

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss. You can take a backup of important data before performing analysis.

    Method 3:

    You can also read the following article and try to optimize the performance of Windows Vista.

    Optimize the performance of Microsoft Windows Vista

    Hope this information is useful.

  • I'm lookng for a product where I can produce a PDF secure for several clients.  When the document is finished, I want to fix it with a password, to make it more difficult to copy, but then I want to record in a secure location, send the link and not

    I'm lookng for a product where I can produce a PDF secure for several clients.  When the document is finished, I want to fix it with a password, to make it more difficult to copy, but then I want to record in a secure location, send the link and the password to the clients.  When customers go to download the PDF, they will have to if they accept the terms and conditions.  If it is accepted, they can download the document.  Working in DocumentCloud PDF services?  Thank you.

    Hi davidc21010281,

    You can try the DC Acrobat Adobe Acrobat download free trial | Acrobat Pro DC. Where you can create a secure PDF file (using Acrobat|) Securing PDF files with passwords) & send them to your customers (send and track online documents |) Tutorials Adobe Acrobat DC), on the other end, customers can download the PDF but they would need the password/certificate in order to open the PDF file.

    See also the FAQ of Adobe Document Cloud.

    Kind regards

    Nicos

  • I've used photoshop for several months when I login, I lost all my fonts and actions... it says that I have zero days left on my trial...

    I've used photoshop for several months when I login, I lost all my fonts and actions... it says that I have zero days left on my trial...

    Log, activation, or connection errors. CS5.5 and later versions

    Mylenium

  • Select the case when several returnvalue? 20 D

    Hello
    I would like to know if there is a solution less than 10g for something like this

    Select case when 'C' = 1
    then
    (select double 1,2,3,4,5)
    on the other
    (select double 6,7,8,9,0)
    end
    of the double.
    (select 1 double 'C')

    What I really need, is the full output of (select double 1,2,3,4,5) or (select double 6,7,8,9,0) If a State due to a different sql query is true or false. No matter if the solution uses 'case when' or anything else.

    Thanks in advance for any help.
    Best regards
    Carsten

    Something like this would work with the example you gave.

    SQL> with test_data as
      2      (select 1 c from dual)
      3  select
      4      1, 2, 3, 4, 5
      5  from
      6      dual,
      7      test_data
      8  where
      9      c = 1
     10  union all
     11  select
     12      6, 7, 8, 9, 0
     13  from
     14      dual,
     15      test_data
     16  where
     17      c != 1;
    
             1          2          3          4          5
    ---------- ---------- ---------- ---------- ----------
             1          2          3          4          5
    
    SQL> edi
    Wrote file afiedt.buf
    
      1  with test_data as
      2      (select 2 c from dual)
      3  select
      4      1, 2, 3, 4, 5
      5  from
      6      dual,
      7      test_data
      8  where
      9      c = 1
     10  union all
     11  select
     12      6, 7, 8, 9, 0
     13  from
     14      dual,
     15      test_data
     16  where
     17*     c != 1
    SQL> /
    
             1          2          3          4          5
    ---------- ---------- ---------- ---------- ----------
             6          7          8          9          0
    
  • Need for the sql query to have several columns in a single coulumn

    Hi all

    I need create the query to have several columns in a single column with several lines.

    Select a.customer_trx_id, a.previous_customer_trx_id
    of ra_customer_trx_all one
    where a.customer_trx_id =: customer_trx_id

    Here, a.customer_trx_id and a.previous_customer_trx_id are in two columns. I need to put them in a single column.

    Say: the foregoing is output
    --------------------------------------------------------------------------------
    a.customer_trx_id a.previous_customer_trx_id

    --------------------------------------------------------------------------------
    123456 87654

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

    Need for a single column

    As


    --------------------------------------------------------------------------------
    123456
    87654

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

    Please do the needful. Please note that it is not the UNION.

    Thank you
    Abdul

    Hello

    You want a way to confirm that what looks like two rows is really a line?

    Here are three ways:

    (1) count the lines:

    WITH  my_original_querry     AS
    (
         select  a.customer_trx_id || CHR(13)
                          || a.previous_customer_trx_id     as id
         from      ra_customer_trx_all     a
         where      a.customer_trx_id      = 274881
    )
    SELECT     COUNT (*)
    FROM     my_original_query;
    

    (2) in SQL * Plus, have SQL * more count them for you:

    SET     FEEDBACK     1
    
    select  a.customer_trx_id || CHR(13)
                     || a.previous_customer_trx_id     as id
    from      ra_customer_trx_all     a
    where      a.customer_trx_id      = 274881;
    

    (3) implicitly count them with the ROWNUM Pseudo-column

    select  a.customer_trx_id || CHR(13)
                     || a.previous_customer_trx_id     as id
    ,     ROWNUM
    from      ra_customer_trx_all     a
    where      a.customer_trx_id      = 274881;
    
  • In any case for a column in a control tree not Visible?

    I would like to hide some data for a column in a tree control. There are string data that my application needs to store and retrieve from a column in a tree control, but it is relatively large and the user has no need to see.

    Is there a way to make a column of the tree control or cells is not not Visible?

    Thank you.

    Hmmm, I don't know if you can hide an arbitrary column (I don't see immediately a way to obtain a reference to it), but if your data is stored in the last column of the control, you can simply resize using the property number of columns. It does not solve all of the data stored in this column (you can resize the rear door and it'll be there).

    Actually, just thought of this: you can define a column activates (identify the column you'll work with), then use the Active cell > cell size > width to set the width of the cell 0, which resizes the entire column. You should be able to get with simple manipulations of here.

    Hope that helps,

  • 2 conditional display for link column

    Hello

    I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

    1. If the user who is viewing the page is an administrator

    2. If the user who visits the page is not an administrator, but sees its own information in this report.

    The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

    For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

    I was wondering if there is a way to simultaneously implement these two conditions together. Thank you!

    kevinsun91 wrote:

    I use Oracle Apex 5.0.2 and I have a report that contains a link to the column. The report contains various user_ids and shows some qualities of these users. I want to make the link in the column of conditional display based on two conditions.

    A "report"? Always tell exactly what you mean by this term: standard report, interactive, component report shared report query or some sort of tabular form?

    1. If the user who is viewing the page is an administrator

    2. If the user who visits the page is not an administrator, but sees its own information in this report.

    The 1st condition, I know how to implement it using PL/SQL expression. I stored the role: APP_USER in a P1_USER_ROLE and check if P1_USER_ROLE = "administrator."

    For condition 2, I know how to implement it using the "value of the element / the expression 1 column = Expression 2.» And I put just expression 1 #USER_ID # and expression 2 P1_USER ID (an element which stores: APP_USER).

    Here are the two different requirements. The first is a restriction on the level of columns that can be implemented with the help of a condition on a column in report or a link. The second is a restriction on the level of the lines who cannot. It is not possible to report using #COL_ALIAS # overrides row values in the State of the reference column. It would be unwise to do so: how APEX can determine if the column should be included or not until all rows are retrieved?

    The conditions of type 'values in the column"referred to value of element / column expression... are those generated by the tabular form wizard, which can be referenced in these expressions for run level row and process validation conditionally based on the submitted values. An example might be triggering a validation not Null in COMMISSION when JOB = 'SELLER '.

    Conditional display of level line in the reports always is possible by including the necessary logic to the report using CASE or other expressions query.

    I was wondering if there is a way to simultaneously implement these two conditions together.

    It is not possible to do in a State of the column. It must be made in the report query using a CASE expression:

    ...
    case
      when    :p1_user_role = 'Administrator'
           or user_id = :p1_user_id
      then
        ... --- Construct link URL
    else
      null
    end col_link
    ...
    

    In other circumstances where it is possible to combine several conditions, use a PL/SQL Expression condition with several predicates and required Boolean.

Maybe you are looking for

  • text indicator showing in videos full screen

    So now it starts to appear in videos to youtube from tonight, it's really a little anyoing when you see a box at the bottom of the video showing "data transfer of...". "even if it's not doing anything you download a box DONE right on the play button.

  • Flash stuck on a site, do not charge not (still invisible) and has no error message

    Hello I like listening to a radio station, but every time I open their website the player built on top is simply not visible at all. It should be just above the add element, but it does not load: http://i.imgur.com/e14UPsy.png The site uses flash, bu

  • IMDb blocked

    26 Firefox blocks the IMDb Did not have this problem with Firefox 25 Do not have this problem with Chrome, IE

  • Broken helmet pin

    Hit my helmet plug on a shoot and it broke leaving pin depth in socket for headphones. Anyone got any ideas on how to get it out? Or will. have to go far to remove...

  • other languages

    Hi, I'm looking to make an app for the playbook and I see instructions for establishing a development of actionscript and javascript development environment.  I was wondering if there is possibility to program for the playbook using other languages?