Help! Multiple Column Output

Hi everyone. I'm hoping someone can help me work through this
problem I'm having outputting data to multiple columns. I'm
creating a photo gallery and I would like my table to look
something like this: empty td, td with photo, empty td, td with
photo, new row below those td's with a caption for the photo. I've
taken tutorials online, but none of them explain how to have
additional rows, or additional columns. Thanks in advance for any
help!

straffenp wrote:
> Hi everyone. I'm hoping someone can help me work through
this problem I'm
> having outputting data to multiple columns. I'm creating
a photo gallery and I
> would like my table to look something like this: empty
td, td with photo, empty
> td, td with photo, new row below those td's with a
caption for the photo. I've
> taken tutorials online, but none of them explain how to
have additional rows,
> or additional columns. Thanks in advance for any help!
>
It is all a matter of figuring out what you want to output
for each
iteration and developing your logic accordingly. The tricky
part I see
with your requirement is that you will need to create two
loops through
each row of output you want, the first loop to create the top
row and
the second loop to create the bottom.

Similar Messages

  • How to get Select All or select Multiple columns  in OOALV

    HI Experts
    i'm assignig internal table to dynamic internal table(FS_IST_TABLE) for to display the output.
    but i'm not geting the Select ALL Option. and i can't select multiple columns at a time.
    where i can select only one column.
    how can i select multiple columns.
    please any one help me.
    regrads,
    rathan.

    Hi,
      If we want to select the multiple columns in the alv by using ooabap
    so in the class CL_GUI_ALV_GRID  it is having one method SET_TABLE_FOR_FIRST_DISPLAY
    it is having one importing parameter IS_LAYOUT of type lvc_s_layo type
    and this structure contains one field SEL_MODE and set that field value as 'A'.
    then we can select the multiple rows in alv grid

  • Sorting records based on multiple columns

    Hi All,
    Please provide SQK query to sort the records in multiple columns
    based on NON NULL and NULL values.
    SID SNUMBER UNIT COUNTRY  STATE
    0 M14762 DE 0
    NULL    NULL            NULL    NULL
    0 990 GB
    0 M14704 IE 0
      M14767 IE 0
    0 M14704 FR 0
    0 M15351 990 GB
              FR 0
    0 D10693 800 GB 0
    NULL    NULL            NULL    NULL
    0 D10693 800 GB 0
    If all column values are NOT NULL those records should come first.
    If first column(SID) values are NOT NULL those records should come next.
    If second column(SNUMBER) values are NOT NULL those records should come next.
    If third column(UNIT) values are NOT NULL those records should come next.
    If fourth column(COUNTRY) values are NOT NULL those records should come next.
    If fifth column(STATE) values are NOT NULL those records should come next.
    If all the column values are NULL those records should come last.
    The output should be like this.
    SID SNUMBER UNIT COUNTRY  STATE
    0 D10693 800 GB 0
    0 D10693 800 GB 0
    0 M14762 DE 0
    0 990 GB
    0 M14704 IE 0
    0 M14704 FR 0
    0 M15351 990 GB
      M14767 IE 0
              FR 0
    NULL    NULL            NULL    NULL
    NULL    NULL            NULL    NULL
    Please help me.
    Thanks.

    Hi,
           For Your Requirement,
    SELECT COALESCE (SID, snumber, unit, country, state) SID,
           (CASE
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND country IS NOT NULL
               AND unit IS NOT NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NOT NULL AND snumber IS NOT NULL
                  THEN snumber
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NULL
                  THEN unit
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN snumber
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
                  when sid is not null and snumber is null and unit is null and country is not null and state is not null then country
               ELSE NULL
            END
           ) snumber,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN unit
               WHEN SID IS NULL AND snumber IS NOT NULL AND unit IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN unit
               WHEN SID IS NOT NULL AND snumber IS NOT NULL AND unit IS NOT NULL
                  THEN unit
               WHEN SID IS NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
                  when sid is not null and snumber is null and unit is null and country is not null and state is not null then state
               ELSE NULL
            END
           ) unit,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NULL
                  THEN country
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
                  THEN country
               WHEN SID IS NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               ELSE NULL
            END
           ) country,
           (CASE
               WHEN SID IS NOT NULL
               AND snumber IS NOT NULL
               AND unit IS NOT NULL
               AND country IS NOT NULL
               AND state IS NOT NULL
                  THEN state
               ELSE NULL
            END
           ) state
      FROM tablx;
    Cheers...

  • How to pivot multiple columns

    Hi,
    I am a newbie in t-sql and i am stuck with pivoting multiple columns. Any help is greatly appreciated!.
    My input table:
    Storeid
    ProductID
    Location
    Sat qty
    sun qty
    Mon qty
    Sat Sales
    Sun Sales
    Mon Sales
    123
    1
    IL
    5
    6
    2
    120
    88
    200
    333
    1
    GA
    2
    3
    8
    200
    120
    80
    456
    2
    CA
    4
    7
    3
    50.5
    93
    300
    I want to achieve output as below:
    Day
    StoreID
    ProductID
    Location
    Qty
    Sale
    Saturday
    123
    1
    IL
    5
    120
    Saturday
    333
    1
    GA
    2
    200
    Saturday
    456
    2
    CA
    4
    50.5
    Sunday
    123
    1
    IL
    6
    88
    Sunday
    333
    1
    GA
    3
    120
    Sunday
    456
    2
    CA
    7
    93
    Monday
    123
    1
    IL
    2
    200
    Monday
    333
    1
    GA
    8
    80
    Monday
    456
    2
    CA
    3
    300
    Please help me in writing t-sql query to get above output. Thank you !

    this?
    SELECT 1 AS dayNo,'Saturday' AS DayName,Storeid,ProductID,Location,Satqty AS Qty,SatSales AS Sales
    FROM table
    UNION ALL
    SELECT 2,'Sunday' AS DayName,Storeid,ProductID,Location,Sunqty AS Qty,SunSales AS Sales
    FROM table
    UNION ALL
    SELECT 3,'Monday' AS DayName,Storeid,ProductID,Location,Monqty AS Qty,MonSales AS Sales
    FROM table
    ORDER BY DayNo,Storeid
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Multiple Column Header in Report (BEx and Web Reporting)

    Hi All,
            I've a requirement where my reports is having multiple column header.
       To be precise the column header is further divided into many sub-columns (upto 4 levels).
    Structure cannot help in this case since we have more than 2 such columns and we are using web reporting as well.
    Here is how it looks
                             <b>Header-A</b>
    Header-B1   |   Header-B2   |   Header-B3    |  Header-Bn
    Hdr-C1 |Hdr-C2 |Hdr-D1 |Hdr-D2 |Hdr-E1 |Hdr-E2 |Hdr-Fn..
    The above is a sample header structure.
    This report will be a Web Based report and I need to know whether its possible to do it in BEx also.
    We are not using Crystal Reports.
    If there is any document related to this, please mail to
    [email protected]
    Thanks & Regards,
    Chandran Ganesan

    Hi Chandran,
    I hope i am getting your problem right.
    If your
    Header-B1 | Header-B2 | Header-B3 | Header-Bn
    Hdr-C1 |Hdr-C2 |Hdr-D1 |Hdr-D2 |Hdr-E1 |Hdr-E2 |Hdr-Fn..
    are a set of key figures, then there is an option.
    For example:
    You drag Header-B1,Hdr-C1 |Hdr-C2
    into column section.Right click on Hdr-C1, Hdr-C2 and select down under. So your Hdr-C1, Hdr-C2 will be under
    Header-B1.
    Like wise drag Header-B2,Hdr-D1,Hdr-D2
    Right click on Hdr-D1,Hdr-D2 and say Down under and these two will fit below Header-B2.
    You can repeat the above steps for Header-B3... Header-Bn
    The output will be same as the one you have specified above.
    Hope it helps,
    Regards,
    Parth.

  • Multipe rows to Multiple Columns - Oracle9i

    Hi
    I know there have been similar threads however I haven't found a suitable solution from them.
    I'm using Oracle 9i and trying to convert multiple rows to multiple columns.
    CREATE TABLE TEST_VALUES
    CUSTOMER_ID NUMBER(10),
    VAL VARCHAR2(100)
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(10,'VAL1');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(10,'VAL2');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(20,'VAL1');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(30,'VAL3');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(30,'VAL4');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(40,'VAL5');
    INSERT INTO TEST_VALUES(CUSTOMER_ID,VAL)VALUES(40,'VAL6');
    COMMIT;
    SELECT * FROM TEST_VALUES
    CUSTOMER_ID     VAL
    10     VAL1
    10     VAL2
    20     VAL1
    30     VAL3
    30     VAL4
    40     VAL5
    40     VAL6
    I want one row per CUSTOMER_ID with two columns to store the values
    CUSTOMER_ID FIRST_VAL SECOND_VAL
    10 VAL1 VAL2
    20 VAL1 NULL
    30 VAL3 VAL4
    40 VAL5 VAL6
    There are only 6 possible 'VAL' values however there are a large number of CUSTOMER_id values. I tried DECODE as suggested elsewhere but that creates 6 columns. However I only want two output columns as there are no more than two values per customer.
    If I had 11g I would try pivot, can anyone please suggest any solutions?
    Many Thanks
    GB

    Thanks Bhushan, that was nearly what I was after. For CUSTOMER 20 it gave
    20 VAL1 VAL1
    so to make it
    20 VAL1 NULL
    I just changed your query slightly to
    select distinct
    customer_id,
    min(val) over (partition by (customer_id)) val1,
    CASE WHEN max(val) over (partition by (customer_id)) = min(val) over (partition by (customer_id)) THEN NULL
    ELSE max(val) over (partition by (customer_id)) END val2
    from test_values
    order by customer_id
    and that gives the correct results. Just checking the full data set now.
    Thanks for your help.

  • Fill multiple columns of the report at once ???

    I have been told that when coding a Report, there is some way to fill multiple columns of the report at once.
    Instead of
    select
    field1,
    field2....
    You could do
    <????> filling field 1 and 2
    My source was vague as to what kind of thing it would be that could give a value to more than one column at one time.
    Can anyone help me here? Sorry to not have any more specifics.
    Thanks, Wayne

    You can have placeholder columns and assign the output of your select statement to the place holder columns.

  • Index Multiple Column of Multiple Tables

    Hi All,
    I would like to know how to create a index which can search through all column in my database tables. Eg: I have 30
    tables and every tables have around 10 columns. I want to create a index which can search through the columns in
    these tables.
    I know that User_DataStore can helps in create multiple column search across multiple tables. But in my case the BLOB
    created will be very huge. Any work around? I mean is there any solutions like concatenated datastore?
    Thank You.
    Regards,
    LG Tan

    Hi,
    I figured out how to do this today. The first thing is that the type of index you need is a USER_DATASTORE.
    The idea behind this type of index is pretty straight forward but the documentation does a very good job of not drawing attention to just how powerful it is.
    The idea behind a USER_DATASTORE is that you can write your own stored procedure to extract the data that you want to index and return it to the indexer. Take an example where you have a master table which contains enough information to allow you to find associated data in other tables i.e. a shared key. The idea is that when you set up a USER_DATASTORE index, you specify the name of a stored procedure that the indexer will call for each row in the master table. The stored procedure has one input and one output parameter, rowid (in) and clob (out).
    When the index is created, the stored procedure you specify is, as I said above, called for each row in the master table. Your stored procedure uses this ROWID to extract the shared key (this can be anything you want) from the master table and uses this to build the necessary SELECT statement to retrieve the related data from the other tables. The rest of the stored procedure simply appends the data returned from your select statement to the return CLOB. The indexer then indexes the inforamation in this CLOB and discards the data.
    The index can of course only return hits against the master table. It's up to your application to extract shared key from the returned row(s), bind to the other tables and present the results.
    You will find a basic example of how to implement USER_DATASTORES in the Oracle Text Reference Guide (http://download.oracle.com/otndoc/oracle9i/901_doc/text.901/a90121.pdf). Feel free to email me if you want some example code.
    Dean

  • Merge statement - update multiple columns from a single sub-select

    Is it possible to write in 10gR2, a MERGE statement, with UPDATE for multiple columns from a single sub_select?
    like this:
    MERGE INTO tableA
    using ( select * from temp) tmp
    on( tableA. col1 = tmp.col1)
    when matched then
    update set  ( tableA.col5,
                       tableA.col6,
                       tableA.col7) = ( select sum(col2), sum(col3), sum(col5)
                                                                                 from tableX
                                                                                where tableX.col1 = tableA.col1...)

    Hi,
    The USING clause is not a sub-query, so it can't reference columns from tables that are not in it.
    Include tableA in the USING clause if you really need to refer to it there. (It's not obvious that you do.)
    As always, it helps if you post:
    (1) The version of Oracle (and any other relevant software) you're using
    (2) A little sample data (just enough to show what the problem is) from all the relevant tables
    (3) The results you want from that data (In the case of a DML statement, such as MERGE, this will be the state of the tables when everything is finished.)
    (4) Your best attempt so far (formatted)
    (5) The full error message (if any), including line number
    Executable SQL statements (like "CREATE TABLE AS ..." or "INSERT ..." statements) are best for (2).
    If you can present your problem using commonly available tables (for example, tables in scott schema, or views in the data dictionary), then you can omit (2).
    Formatted tabular output is okay for (3).

  • Result to be in multiple columns instead of one

    Hi,
    i have used the below sql :
    select parent_id, max(sys_connect_by_path(name,'^')) History
    from (select parent_id, name, row_number() over (partition by parent_id order by name) rn
    from notes )
    start with rn = 1
    connect by prior rn = rn-1
    and prior parent_id = parent_id
    group by parent_id
    order by parent_id
    this gets me the 'HISTORY' row returned in a single column. Problem is if i have 5 HISTORY notes, they all appear in same column with delimiter ^.
    Please help to modify query as to get History as multiple columns instead of 1
    Below is example of sample data returned , NOTE: history could contain any amount of rows.
    ID     HISTORY
    1     ^TT updates requested^TT updates requested^Update on TT #104836
    2     ^Call back actioned^Delivery Update^Internation Dialing ^TT Follow up (147023)
    3     ^Queried poor signal strength
    Idea case would be :
    ID     HISTORY HISTORY1 HISTORY2
    1     TT updates requested TT updates requested Update on TT #104836

    Hi,
    You might want to leave the results as one long string, but just add some spacing.
    Right now you're using
    sys_connect_by_path(name,'^')and getting output like
    1 ^TT updates requested^TT updates requested^Update on TT #104836
    2 ^Call back actioned^Delivery Update^Internation Dialing ^TT Follow up (147023)
    3 ^Queried poor signal strengthwhich is as hard to read as an OTN posting that doesn't use \ tags.  Naturally you're not going to insult your uses by asking them to read something like that.
    If you use this instead:REPLACE ( sys_connect_by_path ( RPAD (name, 32)
                   ,'^'
         , '^'
    then the output will look like this:TT updates requested          TT updates requested          Update on TT #104836
    Call back actioned          Delivery Update               Internation Dialing           TT Follow up (147023)
    Queried poor signal strength
    See this thread:
    Re: Report count and sum from many rows into many columns
    for various ways to deal with problems like this.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Converting multiple column in single column

    Hi All,
    I need to create a table with single column by using select statement with multiple columns
    For Ex- i have 1 row with 10 columns (may be more than 10) like
    'A','B','C','D','E','F','G','H',I','J'
    i written sql like
    select 'A','B','C','D','E','F','G','H','I','J' from dual
    result is - 'A','B','C','D','E','F','G','H','I','J' with 10 columns
    Now i need output lik this using SQL
    Text
    'A'
    'B'
    'C'
    'D'
    'E'
    'F'
    'G'
    'H'
    'I'
    'J'
    Please help me to sort out this problem. Your help would highly appropriated.
    Regards
    Raju
    Edited by: 888667 on Apr 8, 2013 10:54 PM
    Edited by: 888667 on Apr 8, 2013 10:56 PM

    Welcome to the forum!!! You can convert column to row like this
    SQL>with my_table
      2  as
      3  (
      4  select 'A' col1,'B' col2,'C' col3,'D' col4,'E' col5,'F' col6,'G' col7,'H' col8,'I' col9,'J' col10
      5    from dual
      6  )
      7  select decode(no , 1, col1, 2, col2, 3, col3, 4, col4, 5, col5, 6, col6, 7, col7, 8, col8, 9, col9, 10, col10) col
      8    from my_table
      9    cross join (select level no from dual connect by level <= 10)
    10  /
    C
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    10 rows selected.
    SQL> To ask question in a better way please read {message:id=9360002} from FAQ

  • Split flat file column data into multiple columns using ssis

    Hi All, I need one help in SSIS.
    I have a source file with column1, I want to split the column1 data into
    multiple columns when there is a semicolon(';') and there is no specific
    length between each semicolon,let say..
    Column1:
    John;Sam;Greg;David
    And at destination we have 4 columns let say D1,D2,D3,D4
    I want to map
    John -> D1
    Sam->D2
    Greg->D3
    David->D4
    Please I need it ASAP
    Thanks in Advance,
    RH
    sql

    Imports System
    Imports System.Data
    Imports System.Math
    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
    Imports System.IO
    Public Class ScriptMain
    Inherits UserComponent
    Private textReader As StreamReader
    Private exportedAddressFile As String
    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
    Dim connMgr As IDTSConnectionManager90 = _
    Me.Connections.Connection
    exportedAddressFile = _
    CType(connMgr.AcquireConnection(Nothing), String)
    End Sub
    Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textReader = New StreamReader(exportedAddressFile)
    End Sub
    Public Overrides Sub CreateNewOutputRows()
    Dim nextLine As String
    Dim columns As String()
    Dim cols As String()
    Dim delimiters As Char()
    delimiters = ",".ToCharArray
    nextLine = textReader.ReadLine
    Do While nextLine IsNot Nothing
    columns = nextLine.Split(delimiters)
    With Output0Buffer
    cols = columns(1).Split(";".ToCharArray)
    .AddRow()
    .ID = Convert.ToInt32(columns(0))
    If cols.GetUpperBound(0) >= 0 Then
    .Col1 = cols(0)
    End If
    If cols.GetUpperBound(0) >= 1 Then
    .Col2 = cols(1)
    End If
    If cols.GetUpperBound(0) >= 2 Then
    .Col3 = cols(2)
    End If
    If cols.GetUpperBound(0) >= 3 Then
    .Col4 = cols(3)
    End If
    End With
    nextLine = textReader.ReadLine
    Loop
    End Sub
    Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textReader.Close()
    End Sub
    End Class
    Put this code in ur script component. Before that add 5 columns to the script component output and name them as ID, col1, co2..,col4. ID is of data type int. Create a flat file destination and name it as connection and point it to the flat file as the source.
    Im not sure whats the delimiter in ur flat file between the 2 columns. I have use a comma change it accordingly.
    This is the output I get:
    ID Col1
    Col2 Col3
    Col4
    1 john
    Greg David
    Sam
    2 tom
    tony NULL
    NULL
    3 harry
    NULL NULL
    NULL

  • Comparison of multiple column values with a single column value

    I have two separate tables say Tab1 and Tab2
    I want to select some datas , which is common to both the tables.
    In tab1 , there is a column 'STATE' and it's value is 'A'
    In tab2, there are multiple columns for the state, say STATE_A,STATE_B, STATE_C ETC and a row is present with the following details
    STATE_A = 1, STATE_B =1 ,STATE_C =0,STATE_D=1
    I need to select STATE when STATE_A ='1',
    if my STATE='B', this STATE has to be selected since STATE_B =' 1', similraly
    if my STATE='D', this STATE has to be selected since STATE_D =' 1',
    If my STATE='C', STATE_C should not get selected since it's '0'.
    Is it possible to do this in a single SELECT statement, where I have some other checks also or else how can I achieve it?

    Maybe this will help
    Select * from STATE_MAS ;
    STATE
    A
    B
    D
    F
    H
    Select * from STATE_CHILD
      STATE_A   STATE_B   STATE_C   STATE_D   STATE_E   STATE_F   STATE_G   STATE_H   STATE_I   STATE_J
            1         0         0         1         1         0         0         0         0         0
    CREATE OR REPLACE FUNCTION GET_STATE (P_VAL VARCHAR) RETURN NUMBER IS
    V_SQL VARCHAR2(200);
    V_COL VARCHAR2(35);
    P_RETURN NUMBER ;
    BEGIN
    V_COL := 'STATE_'||P_VAL;
    V_SQL := 'SELECT 1 FROM STATE_CHILD WHERE '||V_COL||' = 1 ';
    EXECUTE IMMEDIATE  V_SQL INTO P_RETURN ;
    RETURN P_RETURN ;
    END;
    SELECT STATE FROM STATE_MAS
    WHERE GET_STATE(STATE) = 1 ;
    STATE
    A
    D

  • How to link Excel Chart with multiple columns dynamically?

    Hi all,
    I have one problem. I have an excel chart which has to read data from multiple columns for it's X-axis values (time stamps) and the same number of values for it's Y-axis from multiple columns. See figure attached.
    Now, you can do this by manually assigning values by holding control key to tell the chart that data from many columns is continued from the first column. i.e, a long data is distributed along may columns. This is done very easily manually.
    Now, how to do it at runtime through LabVIEW 8.0?
    Although, I have done it through labview when there where only two columns, A and B streching up to any length. But, now to save space we are dumping into many columns in the same page and want the chart plot that data as we dump it. 
    It is tough since I don't know how to assign SourceData of the chart through labview.
    I have attached chart's SourceData picture.
    Hope you all can solve my problem.
    The Y-axis values are: =(good!$B$30:$B$70,good!$D$30:$D$70,good!$F$30:$F$70,good!$H$30:$H$70,good!$B$71:$B$140,good!$D$71:$D$140,good!$F$71:$F$140,good!$H$71:$H$140,good!$B$141:$B$189)
    good is the name of the file.
    The X- axis values are: =(good!$A$30:$A$70,good!$C$30:$C$70,good!$E$30:$E$70,good!$G$30:$G$70,good!$A$71:$A$140,good!$C$71:$C$140,good!$E$71:$E$140,good!$G$71:$G$140,good!$A$141:$A$189)
    See the columns vary from A to F.
    I have still not got what I love.....
    Attachments:
    ExcelChart.JPG ‏113 KB
    SourceData.JPG ‏34 KB
    XY values.JPG ‏36 KB

    Ok i solved the excel chart problem. Here is the figure showing my victory! But offcourse with NI forum help.
    Message Edited by Halemani on 09-19-2008 06:33 AM
    I have still not got what I love.....
    Attachments:
    Chart_XValues_Values.JPG ‏36 KB

  • Format on multiple columns issue ...

    Post Author: needhelptoo
    CA Forum: Formula
    I'm having issues with the way the data is displaying.I am using the Format Multiple Columns.I have 3 across set.I have the Down and Across checked.My report with the 3 columns is a custom labels sheet.I need to have the down part always be 8 columns.i can't set that anywhere like the 3 columns across.as the sheet used to print the info are labels and perforated for each label (column)I have the following:1.
    Group Header #1 on InvoiceNumber. This have my invoice header
    information related to the customer of the invoice. Keep Together
    selected.2. Group Header #2 on a formula {@sort}. This is suppressed and as  a {@reset} formula in it.3. Details section has {@accum} and section suppressed. Keep Together selected.4. Group Footer #2 as the {@display} formula with Paragraph Formatting. Keep Together selected.5. Group Footer #1 on InvoiceNumber has add'l customer related info for the invoice.so 5 sections in my design view with 2 groups.It'll display the information in InvoiceNumber order in ascending order down first.But the last one on the 1st column is only part of the invoice info and the rest of it starts from the top of the 2nd column.and
    then shifts all the columns according to that. Which of course then
    does not print on the allotted space of the actual label. part of info
    is on one and the rest on another.obviously this won't work. I think i tried everything I can think of and I'm not expert. Barely a novice at this.any help would be appreciated!

    Post Author: V361
    CA Forum: Formula
    In the layout tab, have you tried the Gap between details ?, you should be able to produce a "mailing label type" report using detail size and gap between details... 

Maybe you are looking for