How to generate a select make a vertical data display at horizontal

Hi All,
I have some problem here.
My table is look as below
tblA
ID Caption
==========
1 ColA
2 ColB
3 ColC
tblB
ColID Value
==========
1 Val1
2 Val2
3 Val3
1 Val4
2 Val5
3 Val6
And I need to make the select result as below:
ColA ColB ColC
==============
Val1 Val2 Val3
Val4 Val5 Val6
Thanks for the person who give help.

Is this what you want?
create table TBLA (id number(2), CAPTION varchar2(10));
create table tblB (colID number(2), value varchar2(10));
insert into TBLA values (1,'ColA');
insert into tbla values (2,'ColB');
insert into TBLA values (3,'ColC');
insert into TBLb values (1,'Val1');
insert into TBLb values (2,'Val2');
insert into TBLb values (3,'Val3');
insert into TBLb values (1,'Val4');
insert into TBLB values (2,'Val5');
insert into TBLb values (3,'Val6');
select DECODE(CAPTION, 'ColA', value, null),
DECODE(CAPTION, 'ColB', value, null),
DECODE(CAPTION, 'ColC', value ,null)  from TBLA, TBLB
where ID=ColID;
COLA  COLB  COLC
Val1          
Val4          
     Val2     
     Val5     
          Val3
          Val6

Similar Messages

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to generate Top sales report from SAP data ?

    Hello experts,
    I am completely a newbie to SAP BO , can any one guide me how to generate TOP sales of the year report from SAP data ?

    Hi David,
    First Let me know the Source & Tools to involve.
    Let me go with the generic approach:
    If the source is BW, then you can create the logic in query designer designer and then you can incorporate the data into the dashboard or webi or crystal report whatever its.
    If the source is sql or anyother DB then it can also be achievable in crystal or webi to write the logic in top 10 values by ranking then you can incorporate the data into the dashboard, but here you can limit the top or bottom values.
    Hope this helps, please revert for more clarifications on this.
    --SumanT

  • How do I magnify an audio waveform vertically and display its dB level?

    How do I magnify an audio waveform vertically, either in the sample editor or in the arrange window? I'm not referring here to the track's magnification though.
    Also, how do I display the WAV's amplitude in dB? Only samples or percentage seem to be possible.

    i've wanted to know the same thing, I've not found ANTYHING in the manual. I don't think you can, Of course, as you said, you can view samples and percentage in the sample editor. There doesn't seem to be any view in the arrange window to set, which would be real nice to have. I think it's just not there.

  • How to generate a matrix from 3 column data

    I am wanting to generate a matrix using the attached data so that x is row 1 and y is column 1. I tried splitting the array and using build array however It didn't work. I've checked the forums but no luck. any insight would be appreciated
    Solved!
    Go to Solution.
    Attachments:
    wafermap.xlsx ‏12 KB
    wafermap.zip ‏10 KB

    matthewk wrote:
    I am wanting to generate a matrix using the attached data so that x is row 1 and y is column 1. I tried splitting the array and using build array however It didn't work. I've checked the forums but no luck. any insight would be appreciated
    I assume that you probably meant: Column 1 is x, Column 2 is y, and column 3 is the value at cell x,y.
    All you need is initialize an array of the proper size, keep it in a shift register, and then replace values in order. Here's a quick draft. You can easily swap rows and columns if needed.
    Of course negative indices are not allowed, so you need to create a proper offset such that the lowest index is zero. You could display it in an intensity graph and set the axis offsets accordingly.
    I simply pasted the excel data into a text diagram constant. You can save the excel file as tab delimited text, then use "read from spreadsheet file".
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    wafermapsnippet.png ‏91 KB

  • How to load this value into the master data display attribute

    Hi ,
    Please share me the knowldege how to load this kind of data into master data display attribtes ..
    Raj + Ravi Ltd (PCG: 13592)
    While loading this data ,i got the error message stating that '+' should not be part of the attributes and () should not be part of the attribute ..but i need all the information as it is available in the example data .
    Do i need to maintain RSKC Settings else some other things required ..
    Please guide me ..
    Regards,
    Raj

    HI,
    Maintain these symbols in RSKC and try to reload the data....

  • How to generate dynamic selection-screen?

    Hi all,
    I have two radio buttons on selection-screen.
    If user-selects the one, Then under the radio button another parameter should be displayed
    if he selects another radio button, the previous parameter should not  be displayed and another parameter should appear in the selection screen under the second radio button.
    Please help by giving the code to solve this problem?
    Thanks,
    Vamshi.

    Hi Vamsi,
    By using AT SELECTION-SCREEN OUTPUT and creating the MOdif id for the selection screen parameter you can achieve the dynamic selection scree..
    AT SELECTION-SCREEN OUTPUT.
    * Modify selection screen as per the radio buttons selected.
      PERFORM modify_sel-screen.
    FORM modify_sel-screen .
    * If radio button - process in range of STR's selected, display STR
    * range and Date range as input
      IF p_rb1 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir2.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    * If radio button - process from excel is selected, give option for
    * user to upload file
      ELSEIF p_rb2 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir1.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " MODIFY_SEL-SCREEN
    see the below example....
    copy the below code you can come to know how the dynamic selection screen happens..
    *                   S E L E C T I O N  S C R E E N                     *
    * Selection criteria
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_rb1  RADIOBUTTON GROUP gr1 USER-COMMAND com1 DEFAULT 'X',
                                             "Process STR's in date range
               p_rb2  RADIOBUTTON GROUP gr1. "Process STR's from Excel
    SELECTION-SCREEN BEGIN OF BLOCK c1 WITH FRAME .
    PARAMETERS : p_apover TYPE zcpeg_fg_related-pl_version OBLIGATORY.
                                                                "PJ1031008
    SELECTION-SCREEN END OF BLOCK c1.
    SELECTION-SCREEN END OF BLOCK b1.
    * Display date range to process STR's
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS: s_banfn FOR w_preq MODIF ID ir1,
                                        "Purchase requisition number
                    s_lfdat FOR w_lfdat MODIF ID ir1.
    "Date range
    SELECTION-SCREEN END OF BLOCK b2.
    * Option for uploading file to process STR's
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_file TYPE rlgrap-filename MODIF ID ir2. "File name
    SELECTION-SCREEN END OF BLOCK b3.
    AT SELECTION-SCREEN OUTPUT.
    * Modify selection screen as per the radio buttons selected.
      PERFORM modify_sel-screen.
    FORM modify_sel-screen .
    * If radio button - process in range of STR's selected, display STR
    * range and Date range as input
      IF p_rb1 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir2.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    * If radio button - process from excel is selected, give option for
    * user to upload file
      ELSEIF p_rb2 EQ c_x.
        LOOP AT SCREEN.
          IF screen-group1 = c_ir1.
            screen-active  = c_0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " MODIFY_SEL-SCREEN
    Regards,
    Prabhudas

  • How to generate individual records out of a date interval in SQL?

    I have the following table in my db:
    group varchar(3), start date, end date, value number
    Obs.: The dates are in the format DD/MM/YYYY
    This table has this single record:
    'group1', 01/11/2007, 15/11/2007, 3
    I need to query this table (using SQL) and generate the following result:
    'group1', 01/11/2007, 3
    'group1', 02/11/2007, 3
    'group1', 03/11/2007, 3
    'group ', 15/11/2007, 3
    Does anybody know how I can produce this output?
    Thank you
    Message was edited by:
    user596855

    > This table has this single record:
    'group1', 01/11/2007, 15/11/2007, 3
    If, at sometime in the future, this table contains more than one record, then the solutions above won't work and you might need a SQL statement like this:
    SQL> create table mytable (groep,start_date,end_date,value)
      2  as
      3  select 'group1', date '2007-11-01', date '2007-11-15', 3 from dual union all
      4  select 'group2', date '2007-11-10', date '2007-11-20', 88 from dual
      5  /
    Tabel is aangemaakt.
    SQL> select groep
      2       , day
      3       , value
      4    from mytable
      5   model
      6         partition by (groep,value)
      7         dimension by (0 i)
      8         measures (start_date day, end_date)
      9         rules
    10         ( day[for i from 1 to end_date[0] - day[0] increment 1] = day[0] + cv(i)
    11         )
    12   order by groep
    13       , day
    14  /
    GROEP  DAY                                                  VALUE
    group1 01-11-2007 00:00:00                                      3
    group1 02-11-2007 00:00:00                                      3
    group1 03-11-2007 00:00:00                                      3
    group1 04-11-2007 00:00:00                                      3
    group1 05-11-2007 00:00:00                                      3
    group1 06-11-2007 00:00:00                                      3
    group1 07-11-2007 00:00:00                                      3
    group1 08-11-2007 00:00:00                                      3
    group1 09-11-2007 00:00:00                                      3
    group1 10-11-2007 00:00:00                                      3
    group1 11-11-2007 00:00:00                                      3
    group1 12-11-2007 00:00:00                                      3
    group1 13-11-2007 00:00:00                                      3
    group1 14-11-2007 00:00:00                                      3
    group1 15-11-2007 00:00:00                                      3
    group2 10-11-2007 00:00:00                                     88
    group2 11-11-2007 00:00:00                                     88
    group2 12-11-2007 00:00:00                                     88
    group2 13-11-2007 00:00:00                                     88
    group2 14-11-2007 00:00:00                                     88
    group2 15-11-2007 00:00:00                                     88
    group2 16-11-2007 00:00:00                                     88
    group2 17-11-2007 00:00:00                                     88
    group2 18-11-2007 00:00:00                                     88
    group2 19-11-2007 00:00:00                                     88
    group2 20-11-2007 00:00:00                                     88
    26 rijen zijn geselecteerd.Regards,
    Rob.

  • Select stmt offset - how can I use select stmt to fetch data.

    kna1-name2 contains store#XXXXXXX where XXXXXXX is a store number.  example : store#3564261.
    I must fetch this.  how can i fetch this ?
    Can I use
    WHERE substr(name2,7,10) CS gt_soldto1-store_no
    or can I use
    WHERE name2+7(10) CS gt_soldto1-store_no
    along with for all entries IN gt_soldto1
    in the below select stmt.
        *SELECT *               
          FROM kna1
          INTO corresponding fields of TABLE gt_kna1
         FOR ALL ENTRIES IN gt_soldto1
          WHERE substr(name2,7,10) as gt_soldto1-store_no
          OR      j_3astcu    = gt_soldto1-store_no
    THANKS IN ADV

    Easiest way would be to create another field in your table gt_soldto1 as NAME2.
    update all entries in gt_SOLD2-NAME2 as  cocatenation of  'store#' + gt_SOLD2-STORE_no
    then use your select statment
    SELECT *
    FROM kna1
    INTO corresponding fields of TABLE gt_kna1
    FOR ALL ENTRIES IN gt_soldto1
    WHERE  NAME2 =   gt_soldto1-name2

  • How to generate .wav files from sound pressure data

    Hi,
    I have sound pressure data (as dB values) vs frequency data.
    How can I create a playable .wav file based on above?
    Note: I do NOT have sound pressure vs time data
    I am working in LV 7.1 FDS on Win2000.
    If really required, I can incorporate VIs from sound and vibration toolkit (version 1.0).
    However, I would prefer a solution that does not need me to do that.
    Thanks in anticipation,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

    All,
    With some help from NI-India, we managed to build a nice sound player and .wav saving utility.
    I have attached the VI sent by NI-India. The key component which was missing in my VI was "resample waveform".
    Note: For some reason, I could not use the attached VI to generate sound but did use the concept to succesfully read my sound pressure data and output it to the speaker (and also save it as .wav file tha can be played on Windows Media Player). Also note that I am now generating sound from sound pressure vs time data. I have not tried generating sound from sound pressure vs frequency data.
    I would love to have the following answered:
    1) What data does the sound write VI expect? Is it Sound Pressure values? What units (N/m2 or dB or dBA)? I think it expects sound pressure data and the units are not relevant. Reason being my next question.
    2) I found that until I mutliply the sound pressure data by a very large number say 10e7, the sound is hardly audible (even when volume was programmatically set to max. i.e. 65535). The sound QUALITY does not change when I change this multiplier.
          2.a) Does that mean its only the relative difference between wave data points that affects sound quality? If yes, then I believe the sound pressure data can be in any units.
          2.b) Is it expected to use this huge multiplier OR did I do something without really knowing what it meant?
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu
    Attachments:
    Sound from FFT (LV 8).vi ‏165 KB

  • How To Hide Time Selection Box from Advance Date Filter in Powerview

    Hi Experts,
    Is there any way to hide Time Selection box appearing in Advance Filter mode for Dates in PowerView??
    Thanks and Regards,
    Mukesh Singh

    Hi Mukesh,
    We can click the Advanced Filter Mode icon on the first to the right of the field name in the Filters area to switch between basic and advanced filters modes. At this time, we can select date and time in the selection box. But there is no such feature for
    us to hide the time selection box in current release of Power View.
    As per my understanding, we can select a time that has no impact on the data in the time selection box to work around this issue.
    Thank you for your understanding.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Make data display as horizontal

    Dear All ,
    I'm developing HR payroll reconiliation XML publisher report , user want data of elements to be displayed horiontaly instead of vertically i used this tag
    <?for-each-group@column:G_ASSIGNMENT_ACTION_ID2;./ELEMENT_NAME_AR?> in the for each of the group & it's displaying right , but the problem that they are many elements so they go out of borders .
    All what i want to do is to make those elements display horizontaly & restrict number of data to be displayed by saying "put 4 elements per each line "
    will someone please help me for the syntax for that
    If something not clear in my question please tell me & i'll clarify it
    Thanks & Best Regards
    Marwa Hussein
    Edited by: miro_feps on Mar 1, 2013 6:59 AM

    Thanks for quick reply.
    I have to change this in Answer.
    e.g. SUM(Transaction Amount by Company, Costcenter).
    For that column group the sum by company and cost center.
    Please let me know I new to OBIEE.Still learning to create reports.
    Thanks,
    Poojak

  • How to process double click on rows of data displayed on html page?

    I need to display rows of data so that user could double click on a particular row to get more details.
    What I could think of doing is to embed an applet with a JTable that could easily process double click event. But the issues I have are:-
    1. I am not able to pass the data (the jsp got from processing some javabeans) to be displayed on the applet's table. It seems the applet needs to get loaded on the user's browser first and then the applet could ask the server (servlet / jsp) to send the data.
    Is there any way to provide data to applet other than html's parameter/value pairs?
    2. As per design, this applet should be used only to display the content. Double click on a row would only open a browser window to display the entire details of the data; there should not be any interaction with the server.
    Is there a better, more elegant way of doing this?
    Thanks.

    I posted a thread on Applet servlet communication here:
    http://forum.java.sun.com/thread.jsp?forum=33&thread=205887
    It uses the ObjectOutput/InputStream so you can send serializable objects rather than just text.
    Cheers,
    Anthony

  • How to go for selective deletion if the request is rolled up???.. URGENT!!!

    hi all,
    we a have a data target which was compressed and rolled up...
    please do suggest us how to go for selective deletion  if the data target was rolled up???
    on what basis we need to do the selective deletion ??
    thanks for ur understanding...
    suggestions would be highly rewarded
    regards
    Prince

    Hi,
    in the subsequent datatargets of your ODS:
    if the requests are only rolled up, then you can delete those requests; now if your aggregates are collapsed then you'll have to dactivate them and reactivate them after. If not you can simply delete them.
    then delete all the requests from your ODS up to the request right after the missing one. This will deactivate you ODS delta init. This is not a problem since when you'll have finished with the above your ODS and subsequent targets will have a consistent status in terms of data.
    Reinit your ODS delta without datatransfer, reconstruct your missing request and the subsequent requests in your ODS.
    Reactivate them (not all together as a single activation, but separately).
    Then load the delta into your subsequent targets.
    Now if the subsequent datatargets are collapsed then you'll have to either reinit with full load or selective delete them. the missing request in your ODS still must be reloaded before!
    If you go for selective deletion you'll have to find the right selection criteria based on the data of your ODS. For instance if you can ensure that only a selected period is incorrect (all the ODS requests from the missing one to the last only contain data for JAN08) then you can selectively delete JAN08 from your subseq targets and perform a FULL load selecting JAN08 from your ODS.
    Then perform an INIT without data transfer... you can then continue your deltas as usual....
    hope this helps....
    Olivier.

  • Select a range of data

    Hi everyone,
    I would like to know how to do to select a range of data (for example on a force/time graph during a jump landing (parable), from a certain value to another) to register it on a special file? I tried the module "separate" or "cut out" but I don't think they will be useful when you don't know when will appear the specifical value you're looking for...
    Is it also possible in Dasylab to know the director coefficient of this type of curve (quite linear...)?
    Thanks!
    Solved!
    Go to Solution.

    Perhaps...
    Select the values in a block (y values) at given positions (y values).
    Calculate the differences, and calculate the quotient.
    M.Sc. Holger Wons | measX GmbH&Co. KG, Mönchengladbach, Germany | DASYLab, DIAdem, LabView --- Support, Projects, Training | Platinum National Instrument Alliance Partner | www.measx.com
    Attachments:
    steigung.jpg ‏187 KB
    steigung.zip ‏6 KB

Maybe you are looking for

  • Error in Log file

    I am wondering if anyone has ever seen errors like this. They started showing up in our log file recently with the error below. Once this error starts, then tons of errors are generated and the log file grows exponentially. 2006-12-12 06:51:26,109 WA

  • Trouble connecting mp480 wirelessly to my macbook pro

    i need like a step by step guide on how to connect my canon mp480 to my macbook pro 13" I have no clue how on how to do this. can you help?

  • Unable to kill X using Catalyst drivers

    My problem is that once I'm in X I can't drop back to the console.  The computer starts in console and then I start X manually with "startx".  That all works but once I'm there, I can't back out.  I'm using XFCE and I've tried ctrl+alt+F2-F6.  That j

  • Trouble burning CDs in MacOSX

    I recently upgraded my iTunes to version 6.0.4. When I attempt to burn an audio CD, I keep getting the message that the burn speed is too fast for my CD drive, and to set a lower speed in the Preferences. I accessed the Help Viewer, which didn't real

  • Preventing contact update in linked email

    I have one business email account linked to my Blackberry for live email updates at the request of my employer. I would like to keep the live email without it automatically adding contacts to the gmail address I use. I only use this address for work