Month columns in Bew query

hi gurus
i have to create a query which columns are :
- January --> Current month (if current year)
- Januray to December (if not)
Variable entries are "year" & "plant".
please tell me how to do for the columns...
Dev

Dev,
I would just drill-across by Month, then turn on zero suppression. That would "hide" any columns where all values are zero, which presumably would be the case for future months.
Hope this helps...
Bob

Similar Messages

  • How to display 3 month columns and YTD column

    Hello,
    I need a help. My report layout requires to display the data in 3 dynamic month columns and one Fiscal year Year-to-date column for a period of time. For example, ending month is FEB:
    Items : DEC : JAN : FEB : FY YTD
    A     : $10     : $11     : $12     : $100     
    B     : $1     : $2     : $3     : $10
    (Note: FY YTD is the total sum from OCT to FEB (5 months), not 3 months to be displayed)
    I tried to create a query and use Matrix with group, but the report always display five (5) month columns
    from OCT to FEB instead of displaying three (3) month columns. If the query is limited to display
    three months as desired, then the total sum will be 3 displayed months only (instead of 5 months).
    How to create a query or how to display three months and FY YTD or do anything else with Oracle Builder9i?
    Thanks,

    You could use the DECODE function and variables
    i.e. have a four column report
    in your query use somthing like
    , decode(period,:P_PERIOD1,1,0)* amount as period1
    , decode(period,:P_PERIOD2,1,0)* amount as period2
    , decode(period,:P_PERIOD3,1,0)* amount as period3
    , amount as ytd
    In your before report trigger poulate the variables with your required values

  • Hi how to apply Chronological sort for a month column?

    Hi All,
    I am struck with how to apply Chronological sort for a month column that contains values like January, February, March, April, May, June.... December. If we apply normal sorting then we can arrange the column values either in ascending order or descending order. But i want the column values to be in this format like jan, feb, mar,apr....dec. Is it possible???
    If this is possible then pls tell me the way in a step wise manner for my better understanding..
    Thanks in Advance
    Thenmozhi

    Hi Deva,
    I tried with the below formula :
    CASE WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='January' THEN 1 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='February' THEN 2 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='March' THEN 3 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='April' THEN 4 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='May' THEN 5 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='June' THEN 6 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='July' THEN 7 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='August' THEN 8 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='September' THEN 9 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='October' THEN 10 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='November' THEN 11 WHEN
    "Order Booked Date Calendar"."Full Month Name (Order Booked)"='December' THEN 12 ELSE '' END
    But it is showing the error like this:
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 17001] Oracle Error code: 604, message: ORA-00604: error occurred at recursive SQL level 1 ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 8 ORA-00932: inconsistent datatypes: expected NUMBER got CHAR at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
    What it is problem? Please help me...
    Thanks

  • How to configure 3 different members under a single Month column

    Hi SAP Gurus,
      My client requirement is to show the report in following format, where under a Month column 3 different columns having
    1) Quantity (Number of unit ) of a product,
    2) its rate (Amount per unit), and
    3) Total (amount)    will appear in a single report.
       I have Month as a Time Dim, while Qty, Rate and Total are members of account dim.
    Que: How to configure such scenario in a single report?
    Jan.2011
    Product Category:            Qty (Input)   Rate (Input)   Total (Output)                    
    Product 1                                               
    Product 2                                             
    Product 3                                             
    Product 4                                             
    Group1                                             
         Where: Total = Qty X Rate                                        
    Thanks and Regards,
    SouarbhD

    Hi,
    Use an EVDRE to create your input schedule. You need to have one row with products and 2 columns with time and account. Choose the memberset options as per the requirement. For the accounts, is total calculated with a dimension formula? If yes, then you just need to enter the values for quantity and rate and send the data. The total will be calculated by the system and will be displayed automatically.
    Hope this helps.

  • Multiple Key figure in a single column of a query

    Hi,
    Is it possible to use muliple key figure like Amount and Qty field together in a column of a query?
    Please advise,
    Best Regards,
    UR

    Hi,
    You will be able to do it with the help of cell definitions.
    Say,you have a structure in Rows :
    A
    B
    For A ..in corresponding column cell,use cell definition with KF1
    For B.....in corresponding column cell,use cell definition with KF2
    this way,you will be able to see both in one column
    I m not sure how much it is relavant to your requirement.But this is one way of gettin it

  • Comment column in a query

    Hello,
    In a BW query, I need to add a column of text comments (for example, the description of a calculation, the unit used, ...). These texts are static, the queries will only be used as static reports (download scheduler), in excel and web, so we can not use any VB script.
    Is it a way to add some text in a cell of a column, as in the following example (columns 2 and 3) ?
    KF1    |    Comment for KF1    |    Euros    |    12
    KF2    |    Comment for KF2    |    %          |    47
    Thanks in advance
    Michaë

    Hi guys,
    finally how you fix this problem?, I need to show a comment in a query column and i don't know if this is posible ¿?, I have a query inside of a wad and I want to show a comment in the columns  of the query with the formula details.
    Please let me know if you this is possible.
    Thanks!, Kinds Regards

  • How to fetch the Date column(or Month column) from the file name from the specified path in ODI 11g

    Hi ALL,
    Can any one help us regarding How to fecth the Date column(or month column) from the file name specified in the path in a generalized way .
    For example :
    file name is :subscribers (Cost) Sep13.csv is specified in the below path
      E:\Accounting\documents\subscribers (Cost) Sep13.csv
    here I need to fetch the "Sep13" as a Date column in the ODI 11g in the generalized way.
    Can any one help us in this case as early as possible.

    I would suggest using a piece of Jython code for this.  Something like this...
    import os
    import os.path
    filelist  = os.listdir(E:\Accounting\documents\)
    for file in filelist:
    datestr = file[19:-4]
    You'd need to work out what to do with datestr next...  perhaps write it to a table or update an ODI variable with it.
    Hope this is of some help.

  • Creating an empty column in a query

    Is there a way to place an empty column in  a query? I would like to put acolumn with no information into the middle of a query. The reason is that the information that goes in that column is not available on any tables in my SQL databases.
    SELECT
    hier.dir_name 
    ,hier.am_name 
    ,hier.fm_name     INSERT BLANK COLUMN HERE
    ,hier.tech_name
    hier.tech_id

    Hi
    "no information" in database is usually NULL value. Is this what you are looking for?
    SELECT
    hier.dir_name
    ,hier.am_name
    ,NULL as fm_name
    --,hier.fm_name INSERT BLANK COLUMN HERE
    ,hier.tech_name
    hier.tech_id
    [Personal Site] [Blog] [Facebook]

  • Access Summary column in a query

    Hi All,
    I am new to oracle reports. I am using report builder 10.1.2.0.2.
    I have a summary column in my report. I would like to use this summary column in another query.
    if is use this column directly in the query, i am getting the below error:
    "Field 'F1' references column '<summary column name>' at a frequency below its group. "
    Both these fields are in the same frame. In the object navigator, both are displayed under the same group name.
    please let me know if there any way to access summary columns in another query.
    Thanks.

    You can use a field from one query in another query as parameter, i.e. preceded by colon. To do this first create link of "Group to Query" type between the first query's group where the summary column is, and the second query.

  • Set Column width in query (not using SQL*Plus)

    How can I Set Column width in query
    I understand you can set column width using
    column col1 FORMAT A5
    select col1 from table1;But this only works in SQL*Plus
    I want to be able to do this in a regular SQL query window (not in SQL*Plus), how can I do it.....
    I am using a 'SQL window' in PL/SQL Developer IDE
    and when I use this syntax it says:
    ORA-00900: Invalid SQL statement
    Any suggestions are appreciated...
    thanks,
    M.

    Did you try using RPAD or LPAD functions? They fill the unfilled part of a string with character you provide... either on right or left side depending on what function you use.
    e.g.
    SELECT RPAD('Smith', 10, ' ') Name FROM dual;http://www.adp-gmbh.ch/ora/sql/rpad.html
    Edited by: Zaafran Ahmed on Nov 10, 2010 11:50 AM

  • Multiple columns from a query sorted vertically

    Is it possible to sort a query resultset vertically, with
    multiple columns across the page, in the following manner, with
    page breaks after 40 rows? I can get it to sort horizontally just
    fine with tables, but how can it be done vertically as shown?
    JONES, Abby JONES, Betty JONES, Dawn JONES, Frank
    JONES, Adam JONES, Bill JONES, Debbie JONES, Gayle
    JONES, Alice JONES, Bob JONES, Denton JONES, Henry
    JONES, Ben JONES, Cathy JONES, Emma JONES, John

    This will get you started. I assume you had the appropriate
    order by clause in your query. I also assume you want 4 columns per
    line.
    My approach would be to convert the query to an array and
    then output the array.
    columns = 4;
    maxrows = 40;
    recordsperpage = columns * rows;
    records = query.recordcount;
    myArray = ArrayNew(2);
    ThisColumn = 1;
    ThisRow = 1;
    if (records gt recordsperpage)
    LoopTill = recordsperpage;
    else
    LoopTill = records;
    for ( ii = 1; ii lte LoopTill; ii = ii + 1){
    myArray[ThisRow][ThisColumn] = query.field[ii];
    increment ThisRow;
    if (ThisRow = MaxRows + 1) {
    ThisRow = 1;
    increment ThisColumn;
    } // if
    } // looop
    You can do the rest

  • Sum of columns in union query

    hi, i am using oracle 10g database..
    how to get the sum of column in union query ?
         select * from (select 100 records from dual), (select 50 available from dual)
    union
    select * from (select 200 records from dual), (select 150 available from dual)
    display should be like
                     records         available
                      100               50
                      200               150
    total            300               200thanks ...

    Peter vd Zwan wrote:
    try this:Grouping by records will not produce correct results:
    SQL> with a as
      2  (
      3  select * from (select 100 records from dual), (select 50 available from dual)
      4  union
      5  select * from (select 100 records from dual), (select 100 available from dual)
      6  union
      7  select * from (select 200 records from dual), (select 150 available from dual)
      8  )
      9  select
    10    case when grouping(records) = 0 then null else 'total' end tot
    11    ,sum(records)   records
    12    ,sum(available) available
    13  from
    14    a
    15  group by
    16  rollup (records)
    17  ;
    TOT      RECORDS  AVAILABLE
                 200        150
                 200        150
    total        400        300
    SQL> select  case grouping(rownum)
      2     when 1 then 'Total'
      3   end display,
      4          sum(records) records,
      5          sum(available) available
      6    from  (
      7            select * from (select 100 records from dual), (select 50 available from dual)
      8           union
      9            select * from (select 100 records from dual), (select 100 available from dual)
    10           union
    11            select * from (select 200 records from dual), (select 150 available from dual)
    12          )
    13    group by rollup(rownum)
    14  /
    DISPL    RECORDS  AVAILABLE
                 100         50
                 100        100
                 200        150
    Total        400        300
    SQL> SY.

  • Retrieve varchar column from Oracle query in a resulset

    Hi, I'am a begginer in JSP Technologies.
    I've do a small jsp that opens a db connection to an oracle, execute a query a show results.
    When the columns of the query are int I've no problem, the jsp show the columns of the resulset, but when the columns selected are varchars the jsp doesn't show anything....
    Can anyone help me?
    Example:
    Table: CUSTOMERS
    Col1 : ID_COSTUMER int
    Col2: CUSTOMER_NAME varchar
    <%
    Connection canal = null;
    ResultSet tabla = null;
    Statement instruccion=null;
    try { Class.forName("oracle.jdbc.driver.OracleDriver");
    canal=DriverManager.getConnection("jdbc:oracle:thin:@XXXXXXXXXXXXXXXXXXXp");
    instruccion = canal.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
    } catch(java.lang.ClassNotFoundException e){};
    String Query = "SELECT ID_CUSTOMER FROM CUSTOMERS";
    try { tabla = instruccion.executeQuery(Query);
    out.println("<TABLE Border=10 CellPadding=5><TR>");
    out.println("<TD>CUSTOMER</TD></TR>");
    while(tabla.next()) {
    out.println("<TR>");
    out.println("<TD>"+tabla.getString(1)+"</TD>");
    out.println("</TR>"); };
    out.println("</TABLE></CENTER></DIV></HTML>");
    tabla.close(); instruccion.close(); canal.close();}
    catch(SQLException e) {};
    %>Results:
    CUSTOMER
    1
    2
    3
    4
    Doing the change in query:
    SELECT CUSTOMER_NAME FROM CUSTOMERS
    I have not results....
    Thank you.

    sorry, I misplaced an ending code bracket on last one
    I'm not really familiar with doing this inside a jsp.. but there are a few things that you should try to make sure that it isn't a database problem before assuming it is a problem on your jsp.... It is possible you have already tried the following but just to make sure.
    When you do the second query does the first two out.printlns that are before the while still output? If not then your query is incorrect.
    Second I would try
    String Query = "SELECT ID_CUSTOMER,CUSTOMER_NAME FROM CUSTOMERS";
    try { tabla = instruccion.executeQuery(Query);
    out.println("<TABLE Border=10 CellPadding=5><TR>");
    out.println("<TD>CUSTOMER_ID</TD><TD>CUSTOMER_NAME</TD></TR>");
    while(tabla.next()) {
    out.println("<TR>");
    out.println("<TD>"+tabla.getString(1)+"</TD>");
    out.println("<TD>"+tabla.getString(2)+"</TD>");
    out.println("</TR>"); };
    out.println("</TABLE></CENTER></DIV></HTML>");I suspect this will also return nothing.. if that is the case then you need to check your database. If it does infact return values for the ID and nothing for the NAME then I'm not sure at this point what the problem is.

  • How Can i add "DateDiff(day, T0.DueDate" as a column in this query?

    How Can i add "DateDiff(day, T0.DueDate" as a column in this query?
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
          CASE  WHEN T0.TransType=13 THEN 'Invoice'
               WHEN T0.TransType=14 THEN 'Credit Note'
               WHEN T0.TransType=30 THEN 'Journal'
               WHEN T0.TransType=24 THEN 'Receipt'
               END AS 'Document Type',
          T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
          ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > [%1]) AND T0.RefDate <= [%1] AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

    Hi,
    As you mentioned not possible to assign the dynamic column in the query.
    will give you example for generate a dynamic column name in SQL query, using this example you can achieve your requirement.
    DECLARE @cols AS NVARCHAR(MAX),
        @query  AS NVARCHAR(MAX)
    select @cols = STUFF((SELECT distinct ',' + QUOTENAME(C.Name) 
                        from [History]
                FOR XML PATH(''), TYPE
                ).value('.', 'NVARCHAR(MAX)')
            ,1,1,'')
    set @query = 'SELECT [Date],' + @cols +'
                 from
                    select [Date], Name, Value
                    from [History]
                 ) x
                pivot
                    max(value)
                    for Name in (' + @cols + ')
                ) p '
    execute(@query)

  • How to return Parameters values as a column in a query?

    Hi All,
    I have number of parameters in a report.
    I need to return its interred values as a column in a query to use this column in a chart.
    I want this column to be the second one in this query:
    SELECT ROWNUM
    FROM ALL_OBJECTS
    WHERE ROWNUM <= 10
    That is if there is any way to use these parameters directly as a column in the chart no need for the previous statement.
    Note: I am using Reports 6i

    Dear sir
    You can enter parameter as column in query like
    select :parameter p1, &hexadecima_paramataer p2, empcode
    from emps;
    that query make parameter as query column .
    &hexadecimal paramater can refer to database column of table emps
    and :paramater can refer to static string

Maybe you are looking for

  • Radio group in classic report based on another column on the same row.

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production Application Express 4.1.0.00.32 How can I have a radio group column based on an LOV utilizing another column on the same row of the report? For example: what if I had a surv

  • The sound of my iPod 5th generation is no longer working

    The sound of my iPod touch 5th generation is no longer working. I did not drop it or anything like that. I just noticed that the sound was no longer working but when I plug in my headphones I can hear the sound perfectly. I called Apple today and the

  • My PB Is Dead. Any Way To Bring It Back ?

    *Hello all,* I've been using Mac for almost 4 years now, and I gotta admit that I can't live without my Mac nor Mac OS X. My Powerbook G4 has got to be the best laptop ever made - it is small yet powerful. I bought mine 3 years ago when Tiger was out

  • ITunes are not seeing my external drive as the library

    Hi, I'm struggling to get music on my iPhone. All our music is stored on an external hard drive that we use with our iPods. My wife and I recently got iPhones and we're trying to put some music on them. iTunes is setup to get the music from the hard

  • Quicktime opening email attachments

    I have an Intel iMac. Lately when I try to open a video email attachment I get the error message" error opening movie" from Quicktime. Quicktime works fine opening and displaying everything else. Anyone had a similar problem? Soultions? Darrel