Colon separated values - reports and charts

Data from a checkbox item is stored in a column separated by colons.
When users try to use the report builder function to chart it is not grouping as we expected.
For example the column contains the following rows:
A:B:C
A:B
C
C
We want the sum of distinct values. For example
A = 2
B = 2
C = 3
Instead we get:
A:B:C = 1
A:B =1
C =2
How can we acheive this?
Nan

Hi,
Checkbox selections (and multiselect list selections as well) are, as you say, stored as colon-delimited strings. This is fine for storing the data but, as you have seen, it is not particularly good for displaying the user's selections. You would need to "explode" the strings into actual values. How you do this will depend on the output you need.
For example, taking the "A:B:C" string as an example, if you only need to know the sum that each represent, you could do that in your SQL statement:
SELECT ..
CASE WHEN ':' || XXXX || ':' LIKE '%:A:%' THEN 2 ELSE 0 END +
CASE WHEN ':' || XXXX || ':' LIKE '%:B:%' THEN 2 ELSE 0 END +
CASE WHEN ':' || XXXX || ':' LIKE '%:C:%' THEN 3 ELSE 0 END ABC_SUM
FROM ...(where XXXX is the column that contains the string)
But, if you need to see A, B and C within the report itself, you may be better off splitting the string into three columns:
SELECT ..
CASE WHEN ':' || XXXX || ':' LIKE '%:A:%' THEN 'A' ELSE NULL END ITEM_A,
CASE WHEN ':' || XXXX || ':' LIKE '%:B:%' THEN 'B' ELSE NULL END ITEM_B,
CASE WHEN ':' || XXXX || ':' LIKE '%:C:%' THEN 'C' ELSE NULL END ITEM_C,
CASE WHEN ':' || XXXX || ':' LIKE '%:A:%' THEN 2 ELSE 0 END +
CASE WHEN ':' || XXXX || ':' LIKE '%:B:%' THEN 2 ELSE 0 END +
CASE WHEN ':' || XXXX || ':' LIKE '%:C:%' THEN 3 ELSE 0 END ABC_SUM
FROM ...If, however, the values relate to records in other tables (for example, the user has selected EMPNO values - which is stored in the string - but you want to show actual employee names), then you would probably have to join your original SQL to the second table to display the values and/or allow the user to filter by a value. But that would make it more complicated and may mean that you end up with more than one row per main record.
Andy

Similar Messages

  • All inventories Value Report and GL Balance Sheet (YTD) not matching

    Hi There,
    We are in 11.5.9 and we are getting mismatch in All inventories Value Report and GL Balance Sheet (YTD).
    Please guide us how to identify where the mismatch is?
    Thanks,
    GR Shankar

    I realise this post is not current, however this is fetched in search results and felt I'd add an additional detail that I just learnt.
    http://docs.oracle.com/cd/E12104_01/books/AnyInstAdm/AnyImp_ConfigFinance6.html
    Oracle BI Applications provides two ways to populate the GL balances (stored in the W_GL_BALANCE_F table), as follows:
    By extracting the GL balances directly from Oracle General Ledger, as follows:
    In DAC, for the Subject Area 'Financials - General Ledger', in the 'Configuration Tag' tab, make sure that the tag 'Oracle - Extract GL Balance' is unchecked for the 'Inactive' checkbox.
    Make sure the tag 'Financials - Calculate GL Balance is checked in the 'Inactive' checkbox.
    Click Assemble to redesign the subject area.
    After the subject area has been redesigned, redesign the execution plans that contain this subject area.
    By calculating the GL balances based on the records in the W_GL_OTHER_F table, which stores all journal lines, as follows:
    In DAC, for the Subject Area 'Financials - General Ledger', in the 'Configuration Tag' tab, make sure that the tag 'Financials - Calculate GL Balance' is unchecked for the 'Inactive' checkbox.
    Make sure the tag 'Oracle - Extract GL Balance' is checked in the 'Inactive' checkbox.
    Click Assemble to redesign the subject area.
    After the subject area has been redesigned, redesign the execution plans that contain this subject area.

  • APEX For reports and charts

    Hi Y'all,
    I have an application running on plsql webtool kit, now only for reports and charts I want to use APEX. I would like to put a reports menu in the application which will take the user to the reports / charts created by APEX. Is that possible?
    Also, the application user will be authenticated at the loggin on time, so when he/she hits APEX I want to pass the same authentication to APEX as well. Is that possible?
    Thanks in advance for your replies.
    -Vatsa

    Hello Vatsa,
    Why don't you just recreate everything in APEX?
    We had a customer that wanted exactly that, but if you do the calculation about supporting a plsql webtoolkit app, it doesn't make sense. APEX is soo much faster to develop in.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://www.apex-evangelists.com/
    -- http://www.apexblogs.info/

  • Creating Table from Multiple Colon Separated Values

    I have a DB table with a field that stores values that may be colon separated as resulting from a checkbox page item.
    1:2
    3:4
    5:6
    My ultimate goal is to turn those values into a table of singular values.
    1
    2
    3
    4
    5
    6
    I've gotten close, but can't figure out how to finish the last step. My first step was to create a single query that concatenated all values into one long string. I am able to get
    1:2:3:4:5:6
    as a result of using the LISTAGG function in the query. My next step was to use a function, STRTAB, that I sourced from this forum to convert the colon delimited string into a result set using the query:
    select * from table( strtab( '1:2:3:4:5:6' ))
    where the string was derived from the LISTAGG query. The query works when I pass the above string, but if I try to insert the actual LISTAGG query it fails with missing expression. My actual query looks like this:
    select * from table( strtab(
    select listagg( RESTRICTED, ':' ) WITHIN GROUP ( order by RESTRICTED ) as ID
    from SZ_LINKED_PROFILES
    where RESTRICTED is not null
    and PROFILE in ( select ID
    from SZ_PROFILES
    where ACCOUNT = :APP_ACCOUNT )))
    Anyone know how I can complete the last step? I know I can do this with pl/sql, but I need this to be a single query as I'm using it as the criteria in an IN expression of a larger query.
    Thanks in advance for your help!
    -Jeff

    Hi
    This should be a lot quicker than using piplelined functions (or any PL/SQL for that matter)...
    CREATE TABLE str2tbl
    AS SELECT '1:2' str
       FROM dual
       UNION ALL
       SELECT '3:4'
       FROM dual
       UNION ALL
       SELECT '5:6'
       FROM dual;
    WITH t_str AS
    SELECT  str||':'                                     AS str,
             (LENGTH(str) - LENGTH(REPLACE(str,':'))) + 1 AS no_of_elements
    FROM    str2tbl
    ),   t_n_rows AS
    SELECT  LEVEL AS i
    FROM    dual
    CONNECT BY LEVEL <= (SELECT SUM(no_of_elements) FROM t_str)
    SELECT RTRIM(str,':')                               AS original_string,
           SUBSTR(str,start_pos,(next_pos - start_pos)) AS single_element,
           element_no
    FROM   (
            SELECT t_str.str,
                   nt.i AS element_no,
                   INSTR(t_str.str,':',DECODE(nt.i,1,0,1),
                                       DECODE(nt.i,1,1,nt.i - 1)) + 1 AS start_pos,
                   INSTR(t_str.str,':',1,DECODE(nt.i,1,1,nt.i))       AS next_pos
            FROM   t_str JOIN t_n_rows nt
                           ON nt.i <= t_str.no_of_elements
    ORDER BY 1, 3;
    Table created.
    ORIG SINGLE_ELEME ELEMENT_NO
    1:2  1                     1
    1:2  2                     2
    3:4  3                     1
    3:4  4                     2
    5:6  5                     1
    5:6  6                     2
    6 rows selected.?
    Cheers
    Ben

  • Having troubles passing values of Shuttle control to SQL Query of Report and Chart Region

    Hello,
    I am very new to APEX and need help for one of the Pa.I have a shuttle control on my page which populates Categories. Once user selects Categories from this control, I wish to pass the values to following SQL query :
    select * from emp_class where category IN ( LIST of VALUES FROM RIGHT SIDE SHUTTLE).
    I tried various ways of doing this including writing a java scripts which reads shuttle value, converts it into below string
    'Category1',Category2',Category3'. Then I set this value to a text box. And then I was expecting that below trcik would work
    select * from emp_class where category IN (:TXT_VALUES)
    I am sure this is not right way and hence its not working. Can you please guide me here with options?
    Many Thanks,
    Tush

    b96402b4-56f7-44ba-8952-fb82a61eeb2c wrote:
    Please update your forum profile with a real handle instead of "b96402b4-56f7-44ba-8952-fb82a61eeb2c".
    I am very new to APEX and need help for one of the Pa.
    Don't understand what this means. What is "Pa"?
    select * from emp_class where category IN (:TXT_VALUES)
    I am sure this is not right way and hence its not working. Can you please guide me here with options?
    This is a common fallacy. In
    select * from table where columnvalue in (7788, 7839, 7876)
    (7788, 7839, 7876) is an expression list and the predicate is evaluated as a membership condition.
    In
    select * from table where columnvalue in :P1_X
    :P1_X is a scalar string, incapable of containing multiple values.
    In an APEX standard report, a PL/SQL function body returning an SQL query report source with lexical substitution can be used to produce a "varying IN-list":
    return 'select * from table where columnvalue in (' || :P1_X || ')';
    where P1_X contains fewer than 1000 values, has been sanitized for SQL injection, and string values are properly quoted.
    Some people suggest the following approach, which will also work in APEX interactive reports:
    select * from table where instr(':' || :P1_X || ':', ':' || columnvalue || ':') > 0
    However this is non-performant as it eliminates the possibility of the optimizer using indexes or partition pruning in the execution plan.
    See varying elements in IN list on Ask Tom, and emulating string-to-table functionality using sql for efficient solutions.

  • How to convert colon separated column values in multiple rows in report

    Hi All,
    I want to display colon separated values from a column, in a multi row in report.
    For example i have a column1 in a table with value 'A:B:C' , column2 has value '1'.
    i want to show in a report three rows using these two columns like
    column1 column2
    A 1
    B 1
    C 1

    Here's one way:
    SQL> create table test (col1 varchar2(20), col2 number);
    Table created.
    SQL> insert all
      2    into test values ('A:B:C', 1)
      3    into test values ('Dg:Ezs', 2)
      4  select * from dual;
    2 rows created.
    SQL> select
      2    t.col2,
      3    regexp_substr(t.col1, '\w+', 1, t2.column_value) c1
      4  from test t,
      5    table(cast(multiset(select level
      6                        from dual
      7                        connect by level <= length(t.col1) - length(replace(t.col1, ':', '')) + 1
      8                       ) as sys.odcinumberlist )) t2
      9  order by 2, 1;
          COL2 C1
             1 A
             1 B
             1 C
             2 Dg
             2 Ezs
    SQL>Edited by: Littlefoot on Jan 31, 2012 10:13 AM

  • Interactive report and corresponding chart at the same time

    Hi,
    Is it possible to show interactive report and chart at the same time. I want to show chart beside the report.
    Any ideas or suggestion please?
    Thanks
    Aali

    Yes and no.
    Yes you can simply create a new chart region. This will have its own independed query.
    No. The chart that you can create with the IR-Chart feature replaces the normal table view.
    What I usually do is to save the Chart as a named report and then you have it as an extra tab in your interactiv report.

  • Data values on Bar Chart in a BI Publisher report (11g)

    I have a bar chart that I created via the layout editor in BI Publisher 11g, and I'm displaying the data values on the chart. That part works great. However, we're noticing that the chart adds zeros to the end of the data values depending on the length of the number being passed to the chart. My data item is a number that is 5 bytes in total, with 2 decimals. If the data value is *10.10*, the data displayed on the bar chart shows *10.10*. But when my data value is *1.10*, the data displayed on the bar chart is *1.100*. And if my data value is *.10*, the bar chart displays *0.1000*. The bar chart adds zeros to the end as the number of characters to the left of the decimal decreases.
    I don't see a way to make it not do that. Has anyone else run into this, and been able to change it?

    Basically what are you trying to do :
    Attaching Mutiple Data Definition to a XML Program and deciding which one to call ased on parameter.Sorry you can not do that one Data DEfinition per Report.
    ut there is one way of doing that.
    Create multiple data defintion( mutiple programs) and then a master program something like
    IF Master Program Param1 = 'X'
    call BI Program 1
    ELSIF Master Program Param1 = 'Y'
    call I Program 2....
    End IF;

  • Date Wise and Storage Location Wise Stock Qty & Value Report......

    Hi Experts,
    We want a report Date Wise(As on 31.03.2008) and Storage Location Wise Quantity & Value Report for only Finish Materials. Is there any report ?
    From Mb5b we canot get storage location wise report as we get only plant level qty and value.
    Pl. guide us.
    Regards,
    Yusuf

    Hi Yusuf,
        Try the Tcode: MC.9 there enter the site and article and executeYou will get details of the article
    stock, value. if you double click the article you will get the details of storage location.
    Hope it will be help for you
    Regards
    GK

  • Difference in S_ALR_87013557 Report and CJI3 Report for Actual Values

    Hi,
    I have created a Project & booked some cost on against WBS Elements. Now when see CJI3 report it shows correct values but in S_ALR_87013557 it shows different value for Actual-Overall. This value is slightly greater than the actual value.
    Please tell me how to resolve this issue?
    Thanks,
    Sandeep.

    Hi,
       CJI3 is a cost element report and S_alr......... is a Heirarchial report which will work on Value categories.
    This may be due inconsistencies in cost either by value categories or by some other way.
    Run CJEN and CJBN then check the report. still the problem persists.
    check the value categories in the IMG whether you have maintained all the cost elements that are used while posting to wbs and check whether there is any diplucation of cost elements by the transaction 'Check Consistency of Value Category' which is available in IMG.
    Navigation IMG>Project System>Costs-->Value Categories.
    Rgds
    Sudhir reddy

  • Call tcode from alv report and passing  group of values

    hi all .
    i want to call tcode from alv report and passing an internal table or group of values to a selection option of that t code ? how
    ex. passing group of GL to fbl3n and display the detials of all .
    thank you

    Dear,
    You have done a small mistake
    --> rspar_line-option = 'EQ'.
         rspar_line-HIGH = PDATE-HIGH.
    u r passing "high" value and in "option u r passing "EQ" so how it will work!!!
    So if u r passing only 1 date or more dates like 01.01.2010 , 15.02.2010 , 10.03.2010 then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'EQ'.
    rspar_line-LOW = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    or if u r passing low & high date means in range like 01.01.2010 to 30.01.2010, then pass
    rspar_line-selname = 'SO_BUDAT'.
    rspar_line-kind = 'S'.
    rspar_line-sign = 'I'.
    rspar_line-option = 'BT''.
    rspar_line-LOW = PDATE-LOW.
    rspar_line-HIGH = PDATE-HIGH.
    APPEND rspar_line TO rspar_tab.
    try above code , hope it helps...
    i think u cannot use "call transaction using bdcdata" in ur case bcoz as u said in ur 1st post u want to display the details of all but still if u want to use then u should pass all parameters in  loop.
    PROGRAM
    DYNPRO
    DYNBEGIN
    FNAM
    FVAL
    ex:-
    LOOP AT GT_TEMP INTO GS_TEMP.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = 'SAPXXXX'.
    bdcdata_DYNPRO = '1000'.
    bdcdata_DYNBEGIN = 'X'.
    bdcdata_wa-fnam = '''.
    bdcdata_wa-fval = ''.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'SD_SAKNR'.
    bdcdata_wa-fval = GS_TEMP-GLACCOUNT.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_PROGRAM = ''.
    bdcdata_DYNPRO = ''.
    bdcdata_DYNBEGIN = ''.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = 'XXX'.
    APPEND bdcdata_wa TO bdcdata_tab.
    ENDLOOP.
    try above code if u r using call transaction...
    Edited by: mihir6666 on Jul 9, 2011 3:10 PM
    Edited by: mihir6666 on Jul 9, 2011 3:11 PM
    Edited by: mihir6666 on Jul 9, 2011 3:13 PM

  • All Inventories Value Report&Inventory Ageing Report& Current And as on Date Stock not matching

    Hello All,
    I am new to inventory. I need some help.
    After opening the periods of purchasing and inventory for the month of April'15. The below reports should match in costing.
    But they are not matching. Kindly help on this as its PROD.
    Inventory Ageing Report
    Current And as on Date Stock Statement With Value Report
    All Inventories Value Report - Average Costing
    Thanks
    RR

    MBEWH is the valuation history, this is only updated with the first movement after a period closure. And the period is a month.
    There is no table in SAP that holds the stock information on daily basis.
    You have to develope this yourself. Easiest method by copying a table like MBEW and MARD  daily to a Z-Table.
    A stock situation  at a certain date can be calculated with MB5B.
    Edited by: Jürgen L. on Aug 5, 2008 4:06 PM

  • Graphs and Charts output in XML Publisher Report

    Hi All,
    I have incorporated the graphs and charts as well as some bitmap images in XML Report (RTF File), When i am taking a output in pdf. it is coming fine and working properly, where as while taking the same output in excel, graphs/charts/bitmap images are not getting displayed. Only you can view the data.
    can you please suggest what's the issue on the same and how can be resolved.
    Thanks & Regards
    Ankur Dawra

    Not sure you are on the right forum...

  • Select multiple items from a list box as values for a parameter of crystal report and Oracle procedure

    -  I have a  Product list box (asp.net) used as multiple selected values for  a parameter. 
    - The Product ID is defined in the Oracle procedure as NUMBER data type. 
    -  In my crystal report, I have a parameter field allow multiple values as p_product_id type as Number.  This is the code in my Record Selection Formula for the report:
    ({?p_product_id}[1] = -1 OR {Procedure_name.product_id} in {p_product_id})
    -  In C#, this is my code
    List<decimal?> productUnit = new List<decimal?>();
    int counter = 0;
    decimal prod;
    for (int i = 0; i < lstProducts.Items.Count; i++)
                  if (lstProducts.Items[i].Selected)
                                if (decimal.TryParse(lstProduct.Items[i].Value, out prod))
                                    productUnit.Add((decimal?)prod);                              
                                    counter++;
           if (counter == 0)
                       productUnit.Add(-1);                      
    ReportingDAO rDataFactory = new ReportingDAO();
    retVal = rDataFactory.GetProductReport(productUnit);
    public CrystalDecisions.CrystalReports.Engine.ReportDocument GetProductReport(List<decimal?> productUnit)
              CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptProductDownload();
              ReportLogon rptLog = new ReportLogon();
             rptLog.Logon(retVal, "RPT_PRODUCT_DOWNLOAD");
             retVal.SetParameterValue("p_product_id", productUnit); 
    I keep having the "Value does not fall within the expected range" when I debug.  My question is, is the data type I used for procedure/Crystal report/ and C# correct ?  I always have problem with the data type.  Any help would be
    appreciated
    Thank you

    Hi progGirl,
    Thank you for your post, but Microsoft doesn't provide support for CrystalReport now. Please post your question in SAP official site here:
    http://forums.sdn.sap.com/forum.jspa?forumID=313
    Thank you for your understanding.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Table or report for customer, g/l account and chart of account together

    Hi All.
    I am looking for any table or report where one can see the followings;
    Chart of account and customer together
    or
    chart of account, g/l account and customer together
    or
    cutomer and g/l account
    I am aware of the all the FI table like KNB1, SKA1, SKAT ..and many others. But I failed to get if any of those tables helps to give all above informations together.
    Unless I am missing something.
    Thanks in advance.

    Hi,
    There many FI Reports available to check Customer & G/L Account combination
    1. FBL3N - G/L ACCOUNT LINE ITEM
    2. FBL5N - CUSTOMER LINE ITEM
    3. FBL1N - VENDOR LINE ITEM
    For Chart of Account / Customer and Chart of account /GL account combination you have to develop the Z Report
    For this you can pre pare by using logic of Revenue Account determination
    The table Name Revenue Account determination: C001
    Techincal information: C001-SAKN1
    Sit with your ABAP Programmer and explain your exact requirement he will prepare the table for you as for your requirement
    Best Regards,
    MH

Maybe you are looking for

  • Ical birthday calendar wrong dates

    Hello, I have an issue with iCal regarding the birthday calendar. It works pretty fine syncing with address book, but it ads the birthday obviously twice. The birthday itself and the day before the birthday. When refering the URL in iCal it directs m

  • PowerPC applications no longer supported

    I have a Mac OS X Lion 10.7.5 and I got Adobe Photoshop elements 4.0. When I insert the CD and try to install Photoshop elements this notification appears: "You can not open the programme 'StatusDisplay', since the PowerPC applications are no longer

  • Garageband POP and LOSS OF SOUND when scrolling through synth sounds fast

    Hey All Ive been getting into Garageband 09 recently, but when I'm playing a track Ive written and scrolling through different synth sounds quickly (to select a new sound on the fly)the speakers sometimes make a POP sound, and then no sound comes out

  • JavaBean as Model ?

    Can I use a javabean (not an EJB) in the model part of the MVC. I use a javabean for extracting information from my database. Thank you vry much.

  • Re: LENOVO TAB S8

    Slightly confused and hope somone can clear this up. It comes pre-installed with some apps: Eg Play Books But these don't seem to update automatically I had to go to Play App Store > Find Play Books and select 'Update' Any advice would be appreicated