Bar chart query - bar subdivisions.

Hi,
I have created a bar chart that is subdivided into two colour reb and blue representing the values yes and no. a count of these yes and no's are performed and displayed on the bar in their appropriate positions.
I am wondering how i could subdivide the bar once more by not only having a red and blue subdivision to represent yes and no, but have the red subdivision divided into 2 colours where one division represents 'big' and the other division represents 'small'.
the bar chart i chose to create initially is a stacked bar chart. (im assuming this is the correct one to continue using for this)
if i go to chart expert->data-> in the 'on change of' section , i have a formula which represent values on the x-axis and i have the field from the database which contains the values 'yes' and 'no'.
in the 'show values' section, I have the field from the database which contains a formula for the count of the 'yes's and 'no's.
the formula i ysed for this is:
if ({MyDB.yes/nofield} = 'YES') Then
1 else 0
can anyone help me with this problem (as i am in dire straits with this one)
thanks.
J

Hi James
If  the group is on a database field, then you won't be able to manipulate the legend howver if it is a formula field then you can put the values that you want to see in the legend.
Or you can create a mock legend with text boxes and the desired values.
Hope this helps!!
Regards
Sourashree Ghosh

Similar Messages

  • Legend needs to display Prompt values / Remove filters from chart query

    Hi
    I have 2 questions for the same chart so I hope it's OK to add them in one post.
    Firstly I have created a chart & added three Select List filters which work fine, the query is below, problem is that when I change back to '-ALL-' I get no data, it has filtered out all records as no data matches the value of '-ALL-' does anyone know the code to get around this?
    My chart query;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS data
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    As I will have several queries like the one above for different options on the same chart, I would like the Legend to show what the user has chosen each time the options are changed ie;
    Something like the bolded text in the query to display the chosen values in the legend;
    select null link, P_MONTH AS MONTH, SUM(CALLS) AS *'P1_WAREHOUSE' || 'P1_ANS_UNANS' || 'P1_PRODUCT'*
    from DATA.MAIN_DATA
    WHERE WAREHOUSE = :P1_WAREHOUSE
    AND ANS_UNANS = :P1_ANS_UNANS
    AND PRODUCT = :P1_PRODUCT
    GROUP BY P_MONTH
    Any ideas/suggests?

    Woof777 wrote:
    Any ideas/suggests?Try the APEX forum ;)

  • Unable to edit wizard created SVG chart query

    Hi,
    I have a problem with an SVG chart that one of the HTML DB wizards created.
    On the generated page the wizard created a selection list item named P30_SHOW.
    This item allows to choose a table column based on which an SVG pie chart is generated.
    The automatically generated chart query is:
    select 'f?p=106:26:&SESSION.:::RP,26:P26_CHART_FILTER,P26_VALUE:'||:P30_SHOW||','||"&P30_SHOW.",
    "&P30_SHOW.", count(*)
    from "TESTTABLE"
    group by 'f?p=106:26:&SESSION.:::RP,26:P26_CHART_FILTER,P26_VALUE:'||:P30_SHOW||','||"&P30_SHOW.",
    "&P30_SHOW."
    The page with selection list and chart worked fine at first.
    But then, when I edited the chart's width on the respective 'SVG Chart Attributes' tab and pressed
    the 'Apply Changes' button I got the following error:
    'Query cannot be parsed, please check the syntax of your query. (ORA-01741: illegal zero-length identifier)'
    I only changed the chart's width, I did not touch the chart's query at all.
    My theory is that HTML DB tries to validate the correctness of the chart's query.
    However, the query references a session variable (P30_SHOW) that is
    not defined in my development session. Consequently, the query is not valid in the
    development context and is refused by HTML DB.
    Now I have two questions:
    1. Is my analysis correct, or are there different reasons for the error I do encounter?
    2. How can I get around the problem? I'd like to use the automatically generated charts,
    but also want to be able to edit them.
    Thanks in advance for helpful comments.
    Regards Holger

    Scott,
    I imported the application using the import/install process. A new application ID was created but was not changed in the chart query. The link was generated by the application wizard. The chart query link is below:
    select 'f?p=103:2:&SESSION.:::RP,2:P2_CHART_FILTER,P2_VALUE:'||:P6_SHOW||','||"&P6_SHOW.", "&P6_SHOW.", count(*)
    from "O_DATA_COLLECTION_POINTS"
    group by 'f?p=103:2:&SESSION.:::RP,2:P2_CHART_FILTER,P2_VALUE:'||:P6_SHOW||','||"&P6_SHOW.", "&P6_SHOW."
    The new application id is 101. It is impossible to modify this query because of message:
    "1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-01741: illegal zero-length identifier"
    This happens even if nothing is changed in the query but just the apply changes button is pressed.
    I had a similar problem with the breadcrumbs menu. The link was also pointing to the old application id 103 instead of the new application id 101. The way I got round that was to delete the breadcrumb template and create a new one. I then had to go through all the pages that referenced that and reset the breadcrumbs menu template in the region definition.
    Thanks Arjen

  • Chart Query and Failed to parse SQL query

    Hi,
    first of all, this is not a question. It is a reminder for me and maybe for someone with the same problem.
    I just fell over this for the 123124 time.
    I have a 3D Chart Query
    select sum(order_ok) value,
          count(*) maximum_value
    from      v_dialer_campaign
    where campaign_uuid = :P300_CAMPAIGN_IDSaving fails with
    "1 error has occurred Failed to parse SQL query!" ...
    Saving the query without validation works, but does not show any result in the chart.
    v_dialer_campaign is a view selecting from a view in a mssql db over database link and HS.
    running the select in sqlplus or toad works.
    Without any trace on freetds/unixodb/hs side, i would have not found the following line:
    [FreeTDS][SQL Server]The data types nvarchar and text are incompatible in the equal to operator.[FreeTDS][SQL Server]Statement(s) could not be prepared.
    Solution:
    with q as (select :P300_CAMPAIGN_ID val from dual)
    select     sum(order_ok) value,
         count(*) maximum_value
    from     v_dialer_campaign
    where     campaign_uuid in ( select val from q)Maybe the error output when validating the query should be included in the APEX error message.
    Same solution applies for dynamic LOV's reading from HS using a where clause.

    I tried your first query on Apex 3.2 and it created a nice dial chart.
    Is there any ORA-xxxxx error along with the "failed to parse SQL query" message? Did you double check column & table name spelling?
    P.S. The second query is invalid (a superfluous comma after the second column).

  • Chart Query problem

    Hi all ,
    I am a newbie to Oracle apex and have stuck in an issue . I am using this query for my Chart Source
    select NULL link, count() Count VALUE , to_char((TRUNC(ORDER_DATE)),'Month') "Month"*
    from  "HR"."OEHR_ORDERS"
    group by to_char((TRUNC(ORDER_DATE)),'Month')
    order by 1 desc
    but it gives this error when i click next
    1 error has occurred
    Failed to parse SQL query!
    select NULL link, count() Count VALUE , to_char((TRUNC(ORDER_DATE)),'Month') "Month" from "HR"."OEHR_ORDERS" group by to_char((TRUNC(ORDER_DATE)),'Month') order by 1 desc*
    Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
    what should i do and what am i doing wrong ? as this query gives the correct result if i run it in SQL window
    thanks for the help in advance

    In your first query, you gave the count(*) column two names COUNT and Value. That I think was your only mistake.
    The column ordering might not matter if you only have one value column, but if you want a single chart query to represent more than one line, then the ordering matters.
    In my application I use an Apex item to hold the entire query as text, including v(...) bindings, and displays 1 to 50 lines, dynamically depending on the number of value columns. The names of the lines are derived from the column names.
    /kenny

  • Stacked Bar Chart Query

    Hello everyone,
    I need some help on a query for a Stacked Bar Chart.
    I copied the following query from the "How To" Pages for a Stacked Bar (HTML DB 2 Day Developer) and adjusted it according to my tables:
    SELECT NULL l,
    sales_month,
    revenue
    FROM (
    SELECT TO_CHAR(o.order_timestamp,'Mon YYYY') sales_month,
    SUM(oi.quantity * oi.unit_price) revenue,
    TO_DATE(to_char(o.order_timestamp,'Mon YYYY'),'Mon YYYY') sales_month_order
    FROM DEMO_PRODUCT_INFO p,
    DEMO_ORDER_ITEMS oi,
    DEMO_ORDERS o
    WHERE o.order_timestamp <= (trunc(sysdate,'MON')-1)
    AND o.order_timestamp > (trunc(sysdate-365,'MON'))
    AND o.order_id = oi.order_id
    AND oi.product_id = p.product_id
    AND p.category = 'Phones'
    GROUP BY TO_CHAR(o.order_timestamp,'Mon YYYY')
    ORDER BY sales_month_order
    The problem now that I have is, that the results are not always correct.
    That means, that the numbers for every month that has 31 days is incorrect.
    I created a chart for 2005 and the numbers for Jan, March, May, July and so on are wrong. I found out that they always include numbers from the next (first) day of the next month, that means that the January number contains the numbers from the 1st of February, that March number contains the numbers of the 1st of April and so on. The only difference of my query is that I did not use a timestamp but rather a date. Can someone tell me what to do to solve the problem without changing the column to timestamp? I assume it has something to do with rounding up or "truncating" the date!?
    I appreciate your help!!

    Is there nobody out there, how might give me a hint ?? :-(

  • Jfreecharts- stacked bar chart query

    Hi all,
    I am using JfreeCharts for building an application which reports the usage metrics of two servers over a period of time.
    Each server does a number of operations which can be broadly grouped under 6 heads and these broad divisions are being used for reporting.
    When I use Stacked bar chart for creating the bar graph image, the order in which the bars get displayed is wierd. The dates start from 25th Feb to 28th Feb. Hence I am expecting the bars for the data from the dates 25th... 26th...27th and 28th; but the bars that come up are the 25th ... 26th... 28th and the 27th... Is there a group utility which can be used to order the grouping??? I am posting my code used for grouping the data.
    map = new KeyToGroupMap("G1");
    renderer = new GroupedStackedBarRenderer();
    for (int i = 0; i < (metricsList2[0].size()); i++)
    map.mapKeyToGroup(((XxccrCropsdbColourgrp)(metricsList2[0]).get(i)).getAttributeName1(), ((XxccrCropsdbColourgrp) (metricsList2[0]).get(i)).getAttributeName2());
    renderer.setSeriesToGroupMap(map);
    From the database the groups being sent are G1,G2,G3 and G4 which correspond to the 4 dates mentioned above.
    Help will be highly appreciated....
    Madhu

    The actual problem is when I am adding data to the map for the grouping , the data is getting jumbled up... The groups which are added to the map are not added in order.

  • Bar chart query

    Hi,
    I have a bar chart and on the bars in the chart there are numbers. Im wondering how to get these numbers into the legend?
    Also, the legend contains some text detailing a count that i setup. (eg count@mywork). How can I alter this text to display what I want displayed?
    Thanks.
    J

    Hi James
    If  the group is on a database field, then you won't be able to manipulate the legend howver if it is a formula field then you can put the values that you want to see in the legend.
    Or you can create a mock legend with text boxes and the desired values.
    Hope this helps!!
    Regards
    Sourashree Ghosh

  • Charting Query: How to show detailed chart when clicked

    Hi , I have a flash chart that shows monthly summary values . When user clicks on a bar ( say for month of JAN), I want to show another chart based on data for JAN only. I am trying to figure out how to show my detail chart when user clicks on a summary bar.
    Can someone advise how can I pass value from parent chart to child chart?
    Thanks
    Aali
    Edited by: aali on 02-Feb-2010 00:30

    Hi Aali,
    Create 2 pages, one for summary the other for detailed (assuming P1 & P2). The query for your first chart needs to link to the second including a month value. It might look something like this:
    select 'f?p=&APP_ID.:2:'||:app_session||'::::P2_MONTH:'||MONTH||':' link, MONTH  label, SUM(SALES) value1
    from TBL_DETAILS
    group by MONTH
    -- :2: is the page you're linking to (detailed chart)
    -- P2_MONTH should be a hidden item on that page to store the month value
    -- MONTH is the value to be passed...this could be some substr(date_col, 4,6) or somethingCreate your Hidden P2_MONTH item making sure it is NOT Hidden and Protected. Page 2 query something like:
    select null link, DAY label, SUM(SALES) value1, SUM(COSTS) value2, COUNT(STAFF) value3
    from TBL_DETAILS
    where MONTH = :P2_MONTH
    group by DAYI don't have info on your tables though so hopefully this is helps.
    Mike

  • Control Chart Query

    Dear Experts
    As part of SAP QM Implementation we are implementing control chart functionality to get graphical representation against measured values for pre-defined parameters. I am facing two issues mainly:
    1. When I try to calculate control limits (clicking calculator button) getting message "Control limits for track 1 could not be calculated". MICs has the upper limit and lower limit maintained which I can see in QAMV table for the inspection lots.
    2. In the attached control chart , I am getting Upper Limit, Lower Limit and the Valuated Result in graphical form, when I try to display the inspection date, for the characteristics against inspection lot, I get lost. System is showing some date 7/14/14 against all the characteristics which I am not sure how to achieve.
    Settings I made:
    Sampling type: Fixed sample
    Valuation mode: SPC inspection
    W/O inspection point
    Sample size: 5
    Chart type:115 Shewhart chart for X bar/USA
    MIC Settings:
    Quantitative / Lower / Upper Sp. Limit / Sampling Procedure / SPC Characteristics / Summerised Recording / Required Char.
    Inspection plan setting is:
    SPC criterion : 020 task list char/material
    Base qty : 1KG
    Control Chart Configurations:
    1. Control Chart Type -115
    a) Change Control Limit not checked
    b) Characteristics Type- Fixed Scope, Record measured values
    c) Reference Axis (x-axis) - Time of Creation ( Do I need to change here to "Object Number" or "Time Of Inspection" ?)
    Any input will be highly appreciated.
    Regards
    SK

    Hello,
    For Control limits your chart needs to closed. and offcourse for calculation u need to have more than one inspection lot. then system will calculate the same. UD is also required against lots.
    Regards

  • Crystal reports - charting query

    Hi.
    I have a database with the following fields:
    'companyname' which contains the values:
    company1
    company2
    company3
    company4
    company5
    company6
    'value' which contains the company values:
    11
    14
    16
    13
    72
    26
    and a 'date' field.
    I have created a CReport that displays information between the dates specified. I am displaying a bar chart with the company names on the x-axis and values on the y axis.
    So i specify a 'from' and 'to' date to display the data and it returns a graph with data.
    On the x-axis is company3, company4, company5.   This then means that company1, company2 and company6 have a value of zero between the dates specified, thus the graph doesnt display those company names.
    Im wondering how i can get it to display all the company names (company1 to company6) and for company 1, company2 and company6, just display a value of zero?
    Please can you help me with this?
    thank you.
    J

    If the rest of the report is dependant on filtering the data based on the date but you still want to show company names that have no data for that date range then you could insert a subreport that returns all data (or filters it down to the 6). Create a formula that outputs the value if the datefield falls within the date range and outputs 0 if it does not. Use this formula as the value field in the chart.

  • Column Chart Query

    Hi,
    I am trying to re-create a chart from excel in Application Express and after much playing I have got the data into one series and ordered correctly, is there any way which I can colour some of the lines in the the series a different colour?
    Cheers
    David
    Edited by: OracleInTheNHS on 10-Jul-2011 08:21

    Hi David,
    What version of Application Express are you using?
    Based on your posts, I'm not 100% sure what results you're trying to achieve. Are you hoping to achieve an overlay effect, like this: http://apex.oracle.com/pls/apex/f?p=36648:11 - or a Group By Series effect: http://apex.oracle.com/pls/apex/f?p=36648:82 ? If it's neither of those looks, then maybe you could take a look at the AnyChart chart gallery, and pinpoint the type of chart you're hoping to create: http://www.anychart.com/products/anychart/gallery/3D-Column-Cone-Pyramid-and-Cylinder-Charts.php.
    Custom colours can be applied to your chart via the 'Custom Colors' option on the Chart Attributes page. In APEX 4.1, we now support a new chart attribute called 'Set Color Level', which allows you to specify whether you want the specified colours to applied per series (i.e. even bar in your series will have the same colour) or per point (i.e. each bar in your series will have a different colour). So the 'Custom Colors' option might meet your needs. If you've got a test case on apex.oracle.com, I'd be happy to take a look - just post the workspace name and temporary login credentials to access it.
    Regards,
    Hilary

  • How to use Item value in chart query

    Hi Folks,
    I am looking to use calander item value in sql query used to populate flash chart. I tried with following query where P2_DATE1 is the calander item name. This says no data found. I am not sure if I am missing some thing with BUTTON settings which I am using to put data into chart.
    Select null "link",to_date(entry_date,'dd-mon-yy hh:mi:ss') "Time in GMT", to_number(load_avg_5,'99.99') "Load Avg 5 Min" from oracle_ocm.top_load_avg --where trunc(entry_date)=:P2_DATE1
    I am new to APEX
    Please help

    Here are few things for you to try:
    Hardcode the value and see if it works. "where trunc(entry_date) = to_date('01-May-2010', 'dd-Mon-yyyy')". If it works, then click Session link at the bottom of the page, and check the value of the item P2_DATE1. If null, then you have a problem. If not null, please ensure that you use TO_DATE function as shown above with proper format mask.
    Good luck.
    Ravi A

  • Pie Chart / Query : Top 3 and Remainder

    Hi
    I am trying to develop a template, which shows various exception information to the end user. There are approximately 20 exception scenarios which are analysed each night and data stored in the cube. This information is then related back to the end user via a simple web template.
    I can show that data in a table nicely.
    I have created an additional query with a "Top 3" condition applied, which results in the 3 exceptions that contribute the mos to the total being displayed. This query can then be used as the source for a pie chart, so the user can see graphically which are the most important exceptions to address.
    I have now been asked to include a "remainder" item in that pie chart, or not have the pie chart add up to 100%. What the user wants to see, is what the top 3 exceptions were, and what all the other exceptions added up to, essentially the difference between 100% and the sum of the contribution (%) of the top 3.
    I can write a query which displays the top 3, and include in that a result row which shows the sum of the percentages. So, for example, it will display the 3 and the total will be 87%, meaning the remaining errors contributed 13%, but how would I get this as an additional row in the query?
    Alternately, is it possible to have a pie chart that doesn't add up to 100%. A pie chart that is incomplete in essence?
    Any advice would be appreciated.
    Cheers,
    Andrew

    Hi Andrew,
    To show the value as a percentage and not have the total be 100%, you need to calculate the value in the query. Create a key figure to calculate the percentage and use a condition to only show the top 3. Conditions wont effect the totals or percentages so the total percentage won't add up to 100.
    I don't think it's possible to show a 'other' value with the remainder.
    Kind regards,
    Alex

  • Line Chart query...having issues with finding the right SQL...tough query

    This initaial entry was much longer and confusing.
    I'm looking to make ar running total based using time periods...see the link in the last post to get to the demo.apex.com area.
    Rob
    Edited by: bostonmacosx on Feb 14, 2013 1:33 PM

    bostonmacosx wrote:
    Hello there. So I hope I can explain this sufficiently:
    OUT OF THE WAY: 11g 4.1.1
    I'm going to simplify my data so that it is clear what I'm looking to do.
    I want to have a line chart grouped by date. Let's say monthly...this is easy to do if you are dealing with one specific date and some value you can build the series against with case statements. I've done that a million times.
    The columns of data I'm dealing with are as follows:
    CREATE_DT(create date)
    RETIRE_DT(retire date)
    MACHINE_TYPE(type of machine)
    So lets say I want to see a line chart where each line(data point) is a MACHINE_TYPE and each bin is a month. That month should be any machine with a CREATE_DT below then end of the month and a RETIRE_DT which is either Greater then the end of the month or is NULL(ala hasn't been retired yet).
    In the query for a chart which is
    SELECT LINK,LABEL,CASE()"",CASE()"",CASE()"" from TABLE GROUP BY ROLLUP(VALUE)I guess I'm not seeing how to be able to put these values together so that it walks month by month and figures out the values and puts them in the correct "bin" of time along the X axis of the chart.
    I hope I'm being semi clear as it is hard to explain this scenario. Nope. Clear as mud.
    If time is plotted against the X axis, what measure is plotted on the Y?
    =============
    on another note I built this table from the data:
    01-JAN-12     01-FEB-12     01-MAR-12     01-APR-12     01-MAY-12     01-JUN-12     01-JUL-12     01-AUG-12     01-SEP-12     01-OCT-12     01-NOV-12     01-DEC-12     01-JAN-13     ENVOS
    59     59     59     59     59     59     59     59     59     59     59     60     60      Alias
    12     26     26     26     26     26     26     26     26     26     26     26     26      Blade
    9     9     9     9     9     9     9     9     9     9     9     9     9      DataMvrUsing the function:
    create or replace FUNCTION ACTIVE_SYSTEMS
    RETURN VARCHAR2
    is
    var1 VARCHAR2(4000):= '';
    start_date DATE:= to_Date('05-JAN-2012','DD-MON-YYYY');
    end_date DATE:= to_Date('08-JAN-2013','DD-MON-YYYY');
    new_start_date DATE;
    BEGIN
    new_start_date:=trunc(start_date,'MONTH');
    var1 := q'!SELECT !';
    while(new_start_date<end_date)
    LOOP
    var1 := var1 || q'! count(case when create_dt<'!'||to_char(new_start_date,'DD-MON-YY')||q'!' and (retire_dt IS NULL or retire_dt>'!'||to_char(new_start_date,'DD-MON-YY')||q'!') then 1 end) "!' ||to_char(new_start_date,'DD-MON-YY')||q'!",!';
    new_start_date:= add_months(new_start_date,1);
    END LOOP;
    var1 := var1 || q'! CMS_NODE_OS.OS_TYPE||' '||node_env as envos from CMS.CMS_NODE LEFT join CMS.CMS_NODE_OS on CMS.CMS_NODE.NODE_NAME=CMS.CMS_NODE_OS.NODE_NAME where retire_dt is NULL group by rollup(CMS_NODE_OS.OS_TYPE||' '||node_env)!';
    RETURN var1;
    END;
    Instead of inadequate attempts to explain this here with fragments of code that we can't do anything with because we don't possess the objects and data they're based on, show us something. Create the objects and some sample data in a workspace on apex.oracle.com and post guest developer credentials. Sketch the required chart or mock it up in a spreadsheet and upload it as an image or PDF so we can see what you're aiming for.

Maybe you are looking for

  • Basics for a Java based text editor.

    I want to try and write a simple java text editor I can upgrade as I learn more about java. Can anyone point me in the right direction or tell me the basic layout of a text editor?

  • ZFS-Oracle Enterprise Linux

    will ZFS support on ORACLE ENTERPRISE LINUX?

  • When I connect my ipod my itunes shuts down?

    as soon as I connect my ipod I get an error message saying itunes has stopped working and it closes! I ran diags in itunes and when I connected Ipod it says no ipod found and when I press the help icon it brings up a page with the following error: HT

  • Clipping line

    [size="3" face="courier new,courier">The X FI soundcard that came with my new Dell has no analogue line-in jack. It only lists two mic jacks and a digital jack. Connecting my TASCAM cassette deck to the back panel mic jack results in a terribly clipp

  • IPhoto 9.6 (910.29) hangs when dragging a photo from events into a slideshow. I am running OS X Yosemite 10.10.2

    iPhoto 9.6 (910.29) hangs when dragging a photo from events into a slideshow. I am running OS X Yosemite 10.10.2 on a Mac from 2011. I am trying to edit a slideshow that was already created. I can delete a photo but I cannot add drag any more photos