PL/SQL in a line chart

Hello,
I am learning to use APEX to build charts on our intranet. I'm getting errors when I try the PL/SQL code below on a line chart (btw I'm a noob in PL).
The error description is after the code. Can someone please point out what's wrong with my code?
Any help will be very much appreciated. Thanks.
declare
q varchar2(4000);
g varchar2(4000);
w varchar2(4000);
c varchar2(4000);
qte varchar2(1) := CHR(39);
begin
q:=' select null link , month, ';
g:=' group by month ';
q:= q ||' to_char(decode((sum(nvl(i_worked,0)) + sum(nvl(o_worked,0))),0,0,null,0,(sum(nvl(i_cont,0)) + sum(nvl(o_cont,0))) *100/ (sum(nvl(i_worked,0)) + sum(nvl(o_worked,0)))),'||qte||'999.00'||qte||')||' || qte||'%'||qte || ' as Cont_Rt ';
q:= q ||' from axe_csa_daily_performance_mth ';
w := ' ';
if :P1_CENTER != 'All' then
if instr(w,'where')=0 then
     w:= ' where CENTER = :P1_CENTER ';
else w:=w||' and CENTER = :P1_CENTER ';
end if;
end if;
if :P1_UNIT != 'All' then
if instr(w,'where')=0 then
     w:= ' where ops_unit = :P1_UNIT ';
else w:=w||' and ops_unit = :P1_UNIT ';
end if;
end if;
if :P1_SUBUNIT!= 'All' then
if instr(w,'where')=0 then
     w:= ' where sub_unit = :P1_SUBUNIT ';
else w:=w||' and sub_unit = :P1_SUBUNIT ';
end if;
end if;
if :P1_TM!= 'All' then
if instr(w,'where')=0 then
     w:= ' where MGR_LNM'||','||'MGR_FNM = :P1_TM ';
else w:=w||' and MGR_LNM'||','||'MGR_FNM = :P1_TM ';
end if;
end if;
if :P1_TL!= 'All' then
if instr(w,'where')=0 then
     w:= ' where LDR_LNM'||','||'LDR_FNM = :P1_TM ';
else w:=w||' and LDR_LNM'||','||'LDR_FNM = :P1_TL ';
end if;
end if;
if :P1_FROM <= :P1_TO then
if instr(w,'where')=0 then
     w:= ' where month >= TO_DATE('||qte||:P1_FROM||qte||','||qte||'mm/dd/yyyy'||qte||') and month <= TO_DATE('||qte||:P1_TO||qte||','||qte||'mm/dd/yyyy'||qte||')' ;
else w:=w||' and month >= TO_DATE('||qte||:P1_FROM||qte||','||qte||'mm/dd/yyyy'||qte||') and month <= TO_DATE('||qte||:P1_TO||qte||','||qte||'mm/dd/yyyy'||qte||')' ;
end if;
end if;
q:= q || w || g;
return q;
end;
1 error has occurred
Invalid chart query: select null link , month, to_char(decode((sum(nvl(i_worked,0)) + sum(nvl(o_worked,0))),0,0,null,0,(sum(nvl(i_cont,0)) + sum(nvl(o_cont,0))) *100/ (sum(nvl(i_worked,0)) + sum(nvl(o_worked,0)))),'999.00')||'%' as Cont_Rt from axe_csa_daily_performance_mth group by month
Use the following syntax:
SELECT LINK, LABEL, VALUE
FROM ...
Or use the following syntax for a query returning multiple series:
SELECT LINK, LABEL, VALUE1 [, VALUE2 [, VALUE3...]]
FROM ...
LINK URL
LABEL Text that displays along a chart axis.
VALUE1, VALUE2, VALUE3... Numeric columns that define the data values.
Note: The series names for Column and Line charts are derived from the column aliases used in the query.

Hello,
Your code:
Invalid chart query: select null link , month, to_char(decode((sum(nvl(i_worked,0)) + sum(nvl(o_worked,0))),0,0,null,0,(sum(nvl(i_cont,0)) + sum(nvl(o_cont,0))) *100/ (sum(nvl(i_worked,0)) + sum(nvl(o_worked,0)))),'999.00')||'%' as Cont_Rt from axe_csa_daily_performance_mth group by monthtry:
select null link , month label, to_char(decode((sum(nvl(i_worked,0)) + sum(nvl(o_worked,0))),0,0,null,0,(sum(nvl(i_cont,0)) + sum(nvl(o_cont,0))) *100/ (sum(nvl(i_worked,0)) + sum(nvl(o_worked,0)))),999) value from axe_csa_daily_performance_mth group by monthI didn't check all the brackets, but by appending a percentage it isn't a value (numeric) anymore....
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/

Similar Messages

  • Line Chart From SQL in 10g

    I need to have a Line Chart from SQL in Oracle 10g Grid Control for the below Scenario
    I had total counts for Messages stuck in the Oracle queue table using one UDM alert
    and i have total counts for messages stuck more than 15 min using another UDM alert.
    Now i have to get a graph with these 2 valus in X axis with counts on Y axis.
    Kindly help me.

    You might want to check the following documentation to see if you can achieve what you need in a custom report.
    Custom reports:
    http://docs.oracle.com/cd/B16240_01/doc/em.102/e14586/information_publisher.htm#BGBFGDCI
    Monitoring views:
    http://docs.oracle.com/cd/B16240_01/doc/em.102/b40007/views.htm#BACDGFJC
    Regards,
    - Loc

  • SVG line chart raises ORA-20001 witha valid SQL query

    Hi,
    I am on version 1.6 & 10g database. I developed an SVG line chart which was working fine, but I wanted to fill in some sparse data by using data densification. So I enhanced my query with a partitioned outer join as follows:
    select null l, month_start, issue_count
    from
    (with dates as
    (select add_months
    ( to_date( '01-jul-2004' ),
    column_value-1) dt
    from table( vtable(12) )),
    iss as
    (select trunc(start_date, 'MON') mon , count(*) cnt
    from issues
    group by trunc(start_date, 'MON'))
    select dates.dt month_start, NVL(iss.cnt, 0) issue_count
    from dates left outer join iss on (dt=mon)
    Now the chart throws an ORA-20001 get_data error. The query is valid as it runs in SQL*plus no problems. What is it choking on?
    Thanks,
    Steve

    Steve,
    I didn't mean for you to put in on the Studio, just install the app in your workspace on htmldb.oracle.com, use SQL Workshop there to compile your procedures, tell us the app ID, and that's it.
    The error message presentation needs some improvement, give us time. We're spending most of our energy on improving the capability of the product.
    Scott

  • Problems with SVG line charts based on PL/SQL returning SQL

    Dear all - I wonder if anyone can tell me whether this problem is likely to be fixed at some point?
    It relates to the fact that you can't get more than one series on a chart where the SQL is returned from PL/SQL.
    It is a huge issue for us when trying to create complex, dynamic charts, which are simple enough in PL/SQL, but end up quite nightmarish in pure SQL.
    Although we have implemented Maani SWF (Flash) charts as a workaround, users don't like them as there's no 'save as...' or copy+paste and they seem to print very badly indeed.
    Here's part of a post from last May with more detail:
    "If I take a really simple table like this:
    CREATE TABLE "CHART_TEST"
    ( "X" DATE NOT NULL ENABLE,
    "Y" NUMBER(5,0) NOT NULL ENABLE,
    CONSTRAINT "CHART_TEST_PK" PRIMARY KEY ("X") ENABLE
    and populate it with:
    X Y
    2006-01-01T00:00:00 1
    2006-02-01T00:00:00 2
    2006-03-01T00:00:00 3
    2006-04-01T00:00:00 4
    2006-05-01T00:00:00 5
    2006-06-01T00:00:00 6
    2006-07-01T00:00:00 7
    2006-08-01T00:00:00 8
    2006-09-01T00:00:00 9
    2006-10-01T00:00:00 10
    I can create a chart with a single series using syntax something like:
    begin
    return 'select null link, x label, y value
    from chart_test';
    end;
    and this works fine. However, if I add a second series:
    begin
    return 'select null link, x label, (y + 1) value
    from chart_test';
    end;
    then the whole of the chart region blanks out.
    There's an example at:
    http://htmldb.oracle.com/pls/otn/f?p=15491:1"
    Many thanks,
    John.

    On some, but not all SVG line charts, I had trouble when some values are ZERO.
    Putting a CASE WHEN var = 0 then 0.05 ELSE var END in the select statement
    fixed those situations.
    I had missing lines when the number of data points in a series exceeded the default number of 15, and I did not set in the series configuration to a number equal to or higher that the number of data points in that series.
    And I had one instance, where a couple missing lines reappeared when I exited
    the browser and app completely and restarted the app.
    All these comments apply to ver 1.6x and 2.0x

  • Putting Category Counts in a Tool Tip on a Line Chart -SQL Server 2008 R2

    I have a line chart report that shows the total number of tickets processed each month. Within the same recordset is the data of who processed the ticket.  So I want to add in the ToolTip on the Datapoints the number of tickets processed  by each
    persion.  There are just a few people.
    So the line chart will have a datapoint at 20, but Joe did 5 and Jim did 15. What expression would I put in the tooltip? I even added datavalues for the Names and hid the data on the chart.  I am just not sure how to reference or write the expression
    that says  joe has 5 and jim has 15 in the ToolTip.  Then I would want an "Other" with all Rogues not Jim or Joe.
    Example of Data
    Ticket #  DATE_REPORTED  ASSIGNEE_FULL_NAME
    1  2013-01-16 08:31:28.000  Joe
    2  2013-01-17 07:01:23.000  Jim
    3  2013-02-04 17:42:23.000   Jim
    4  2013-02-04 18:42:23.000   Bill
    Thanks in advance.
    DBA Developer

    Hi Paul,
    As per my understanding, if we want to display some detail information depend on one field, we should add a group on that filed ahead. In your scenario, we should add a Category group or Series group in the chart, then write an expression to display the
    detail information. While, if we additional add a group in the chart, the chart would showed with other manners. It will be different from the original chart. So, I think we cannot directly achieve the goal at the moment.
    As a workaround, I suggest we can create another report to only display the detail information, then add a drill through action in the main report to jump to that report when we click the line. For more details, please refer to the following steps:
    Drag a Line Chart on the design surface of the new report.
    Insert [Count(Ticket__)] in the Values pane.
    Insert the expression below as the Category Group Label expression and Group expression:
    =format(Fields!DATE_REPORTED.Value,"MM")
    Insert the expression below as the Series Group Label expression and Group expression:
    =iif(Fields!ASSIGNEE_FULL_NAME.Value="Joe",Fields!ASSIGNEE_FULL_NAME.Value,iif(Fields!ASSIGNEE_FULL_NAME.Value="Jim",Fields!ASSIGNEE_FULL_NAME.Value,"Others"))
    In the main report, right-click the line to open Series Properties dialog box.
    Click Action in the left pane, enable Go to Report, then specify the new report name in the drop-down report.
    If we want to see the detail information, we can click the line in the main report, it navigates to the new report. Then we can click “Back to Parent Report” action to return to the main report.
    Hope this helps.
    Regards,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • 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.

  • What is the best way to create a SSRS 2005 Line Chart Report for a 12 month period?

    I'm looking for advice on how to create a SQL Server 2005 query and line chart report for SSRS 2005.
    I need to display the peak number of patients assigned to a medical practice each month for a 12 month period based on the end-user selecting a
    single month and year.
    I've previously created a report that displays all patients assigned to the practice for any single month but I’m looking for advice on how to
    how to produce a resultset that shows the peak number of patients each month for a 12 month period. I thought about creating a query that returns the peak count for each month (based on my previously created report which displays all patients assigned to the
    practice for any single month) and then use a UNION statement to join all 12 months but I'm sure that isn't the most efficient way to do this. The other challenge with this approach (twelve resultsets combined via a UNION) is that the end-user needs to be
    able to select any month and year for the parameter and the report needs to display the 12 month period based on the month selected (the month selected would be the last month of the 12 month period).
    For the report I’ve previously created that displays all patients assigned to the practice for any single month, the WHERE statement filters the
    resultset on two fields:
    Start Date - The date the patient was assigned to the practice. This field is never null or blank.
    End Date - The date the patient left the practice. This field can be null or blank as active patients assigned to the practice do not have an End Date. When the patient
    leaves the practice, the date the patient left is populated in this field.
    Using these two fields I can return all patients assigned to the practice during Nov 2012 by looking for patients that meet the following criteria:
    start date prior to 11/30/2012 (using the last day of the month selected ensures patients added mid-month would be included)
    AND
    end date is null or blank (indicates the patient is active) OR the end date is between 11/1/2012 -11/30/2012 (returns patients that leave during the month
    selected)
    Regarding the query I need to create for the report that displays the peak count each month for 12 months, I'm looking for advice on
    how to count patients for each month the patient is assigned to the practice if the patient has been assigned for several months (which applies to most patients). Examples are:
    John Doe has a start date of 6/01/2012 and an End Date of 10/07/2012
    Sally Doe has a start date of 8/4/2012 and no End Date (the patient is still active)
    Jimmy Doe has a  start of 7/3/2012 and an End Date of 9/2/2012
    Given these examples how would I include John Doe in the peak monthly count each month for May - October, Sally Doe in the peak monthly count for
    August - December and Jimmy Doe in the peak monthly count for July – Sept if the end-user running the report selected December 2012 as the parameter?
    Given the example above and the fact I'm creating a line chart I think the best way to create this report would be a resultset that looks like
    this:
    Patient Name              
    Months Assigned
    John Doe
    June 2012
    John Doe                     
    July012
    John Doe                     
    Aug 2012
    John Doe                     
    Sept 2012
    John Doe
    Oct 2012
    Sally Doe                     
    Aug 2012
    Sally Doe                     
    Sept 2012
    Sally Doe
    Oct 2012
    Sally Doe                     
    Nov 2012
    Sally Doe
    Dec 2012
    Jimmy Doe                  
    July 2012
    Jimmy Doe
    Aug 2012
    Jimmy Doe
    Sept 2012
    From the resultset above I could create another resultset that would count\group on month and year to return the peak count for each month:
    June 2012 - 1
    July 2012 – 2
    Aug 2012 - 3
    Sept 2012 - 3
    Oct 2012 - 2
    Nov 2012 - 1
    Dec 2012 - 1
    The resultset that displays the peak count for each month would be used to create the line chart (month would be the X axis and the count would
    be the y axis).
    Does this sound like the best approach?
    If so, any advice on how to create the resultset that lists each patient and each month they were assigned to the practice would be greatly appreciated.
    I do not have permissions to create SPs or Functions within the database but I can create temp tables.
    I know how to create the peak monthly count query (derived from the query that lists each patient and month assigned) as well as the line chart.
    Any advice or help is greatly appreciated.

    Thanks for the replies. I reviewed them shortly after they were submitted but I'm also working on other projects at the same time (hence the delayed reply).
    Building a time table and doing a cross join to my original resultset gave me the desired resultset of the months assigned between dates. What I can't figure out now is how to filter months I don't want. 
    Doing a cross  join between my original resultset that had two dates:
    08/27/2010
    10/24/2011
    and a calendar table that has 24 rows (each month for a two year period)
    my new resultset looks like this:
    I need to filter the rows in yellow as the months assigned for stage 3 that started on 8/27/2010 should stop when the patient was assigned to stage 4 on 10/24/2011.
    You'll notice that Jan - Sept 2011 isn't listed for Stage 4 assigned on 10/24/2011 as I included a filter in the WHERE clause that states
    the Months Assigned value must be greater than or equal to the date assigned value.
    Any advice would be appreciated.

  • Display column values as a series/legend on a line chart where one column value can be more than one category

    Hi Everyone
    I don't know if this is possible or not, so I will describe it. I have a column in a table called Filing. There are currently three values in it ("Abuse", "Neglect", "Voluntary") and each record has this populated. I also have
    the below slicer for the column also.
    I would like to add a fourth value called "Abuse/Neglect" that would identify instances where both an Abuse and Neglect petition was filed, which is a subset of the Abuse and Neglect records in the Filing column.
    My question is, is it possible to create a line chart that has the 4 Filing possibilities: "Abuse", "Neglect", "Voluntary", "Abuse/Neglect" as the Series/Legend in the line chart?
    The problem is that there are records that are more than one category: Abuse or Neglect records can also be Abuse/Neglect.
    Paul

    Hi Paul,
    According to your description, there is a column with the values ("Abuse", "Neglect", "Voluntary") in your table, now what you need to is that add another value "Abuse/Neglect" in this column, and then use it
    as Series/Legend in the line chart, right?
    In this case, you can add calculated column to your table based on your logic. A calculated column is a column that you add to an existing PowerPivot table. Instead of pasting or importing values in the column, you create a DAX formula that defines
    the column values. The calculated column can be used in a PivotTable, PivotChart, or Power View report as you would any other data column. Please refer to the link below to see the details.
    https://msdn.microsoft.com/en-us/library/gg413492%28v=sql.110%29.aspx?f=255&MSPPError=-2147217396
    Regards,
    Charlie Liao
    TechNet Community Support

  • Hint Values on Line Chart

    When you setup a line chart, the LABEL portion of the SQL query becomes the X axis value on the line chart. When there are multiple series on a line chart, each series is its own distinct line. If the series has a LABEL that is not yet on the chart, it adds that label to the x axis at the end of the axis. If the new series has a LABEL that is already on the chart, then it places the Value on that existing place on the x-axis. This Label is also used in the Hint portion of the chart.
    So lets compare the number of Sales per day of a Department across a length of time, say 3 months. So, on first working day on Jan dept A has 31 sales. On the second working day of January thay make 35 sales and so on until March 31. Our company doesn't work on weekends so we won't have sales on those dates. Dept B has their numbers for the same dates.
    We setup a series for each month (Jan, Feb, March). Then we place the total number of orders for each date on the graph and connect the dots! Great! But wait, the more months I add, the shorter each line gets on the graph. What if we were comparing 3 years worth of data instead of 3 months. The x-axis would have 600-700 values instead of 60-70 values. Oh my.
    What if we make each series of data its own line over the same scale? That way each month shows in the same space with the first day of the month at the left and the last day of the month near the right. Sounds good. But wait, we are now making up a scale. And when we do this, the Hints on the data points become meaningless. I want to show the actual date value in the hint but have the line over my custom X-Axis. What I need is an additional field that I can use to add to the Hint portion of the chart. Obviously, this would require using custom xml and a custom data element, but is this even possible given the constraints of the SQL syntax?
    To visualize this issue better: http://apex.oracle.com/pls/otn/f?p=28155:1
    Austin

    Andy -
    I need to thank you for the direction on the substitution variables reference. That will be a major help.
    However, i must correct a statement (underlining is mine)
    So, if you switch to Custom XML and find the <tooltip> tag and add {%SeriesName} after the existing {%Name} entry, you end up with the _"day of the month" (which is your value)_ and the Series Name value, which is January - so, "1 January"This is a common misconception that the numeric value on the x axis represent the "day of the month" , when in fact it does not. You logically cannot use the day of the month for this type of axis. Why not? It is because weekends are excluded. So, one month may begin on a Friday. If that were the case then the 2nd of the month would be a Saturday, which would work for a single series of data. But what about when you add in the next month and it begins on a Tuesday. Well then, if you use the day of the month as the value, the 2nd day of the second series actually gets plotted after all the days of the first month.
    The solution is that you have to generate a common arbitrary scale for all series of data. When you do that, you lose the date values.
    I have tried to illustrate all of this by adding to the existing examples in the link provided above. Some other odd behaviors of using the day of the month as the x-axis value can be seen as well. I have also implemented the suggestion of adding the {%SeriesName} tag to the Hint via the custom xml.
    Austin

  • Diagonal line on SSRS line chart

    Hi all,
    I'm struggling with a charting issue that I was hoping someone here might be able to help with - I've looked through various blogs without success. I need to insert a diagonal line running the full width of a line chart, representing the linearly increasing
    target value over a month. The actual data will then be a secondary series on the same vertical axis, showing progress against the target based on today's data.
    This report has several limitations that I should emphasise before someone says "Well, why can't you just generate the target data in the SQL query?". It's for Dynamics CRM Online, so the only type of data source and query allowed is FetchXML.
    I can't even use a simple SQL query that returns constant values, let alone an actual SQL DB query. It also doesn't seem to be possible to have any custom code in the report, which makes it even more frustrating. FetchXML is just not set up to do things like
    return constant values in a query, or return a dataset which is the set of days in the current month.
    What I do have is two datasets, one of which returns the actual data, which I've used as the first series in the table, and a second dataset that returns a single value that represents the target for the month. There's no way, as far as I'm aware, to cross-join
    that with a set of dates and then use a calculated field in the dataset to turn it into a linear series.
    I've set the min and max values of the X-axis to show me all dates, and my initial solution to the problem was to have a horizontal line at the target value, as shown below (red dotted line). However, I've been asked to change that to the solid red diagonal
    line as shown:
    Series 1 (Total order value) is the RunningValue of the daily order values, summed across the dates. 
    Series 1 data looks something like this:
    [Date] [Order Value]
    1 Mar 100
    3 Mar 20
    3 Mar 35
    24 Mar 400
    Series 2 data just has
    [Target Name] [Target Value]
    Sales Target 25000
    Does anyone have ideas on how I can do this? I'm happy to take any suggestions; the line doesn't have to be interactive or be an action, so it could even be rendered directly onto the chart, if that's possible. The only limitation is that it needs to be
    viewed on screen, and be printable. I'd prefer some sort of elegant approach that allows me to do it as two series on the same chart, but frankly at this point I'm beyond caring how it's done - so long as it works, it can be held together with chewing gum
    and string.

    Hi Anuruddha,
    When you want to see the diagonal line, you should divide the target value with number of values in x-axis,
    let say Month March  has 31 days, your target is 25000
    then 25000/31=806.4516129032258
    But to do dynamic you need to get the number of days in month
    =day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))
    Create another series like below shown:-
    a Above expression  :-
    = (Sum(Fields!target.Value, "DataSet2")/ (day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))))*Fields!id.Value
    Run the report:-
    Orange Line is yours previously, Red Line is what you want.
    I am doing calculation in series, so there is no problem for you as you can't write SQL query.
    Below is the RDL code , which will help you to check the expressions.
    <?xml version="1.0" encoding="utf-8"?>
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
    <Body>
    <ReportItems>
    <Textbox Name="textbox1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Sparkline</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>12pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>SteelBlue</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style>
    <TextAlign>Center</TextAlign>
    </Style>
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox1</rd:DefaultName>
    <Height>0.37in</Height>
    <Width>5in</Width>
    <Style>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    <Chart Name="Chart1">
    <ChartCategoryHierarchy>
    <ChartMembers>
    <ChartMember>
    <Group Name="Chart1_CategoryGroup">
    <GroupExpressions>
    <GroupExpression>=Fields!workday.Value</GroupExpression>
    </GroupExpressions>
    </Group>
    <SortExpressions>
    <SortExpression>
    <Value>=Fields!workday.Value</Value>
    </SortExpression>
    </SortExpressions>
    <Label>=Fields!workday.Value</Label>
    </ChartMember>
    </ChartMembers>
    </ChartCategoryHierarchy>
    <ChartSeriesHierarchy>
    <ChartMembers>
    <ChartMember>
    <Label>value</Label>
    </ChartMember>
    <ChartMember>
    <Label>target</Label>
    </ChartMember>
    <ChartMember>
    <Label>id</Label>
    </ChartMember>
    </ChartMembers>
    </ChartSeriesHierarchy>
    <ChartData>
    <ChartSeriesCollection>
    <ChartSeries Name="value">
    <ChartDataPoints>
    <ChartDataPoint>
    <ChartDataPointValues>
    <Y>=RunningValue(Fields!value.Value,Sum,"DataSet3")</Y>
    </ChartDataPointValues>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <DataElementOutput>Output</DataElementOutput>
    </ChartDataPoint>
    </ChartDataPoints>
    <Type>Line</Type>
    <Style />
    <ChartEmptyPoints>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    </ChartEmptyPoints>
    <ValueAxisName>Primary</ValueAxisName>
    <CategoryAxisName>Primary</CategoryAxisName>
    <ChartSmartLabel>
    <CalloutLineColor>Black</CalloutLineColor>
    <MinMovingDistance>0pt</MinMovingDistance>
    </ChartSmartLabel>
    </ChartSeries>
    <ChartSeries Name="IDDetails">
    <ChartDataPoints>
    <ChartDataPoint>
    <ChartDataPointValues>
    <Y>=Sum(Fields!target.Value, "DataSet2")</Y>
    </ChartDataPointValues>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <DataElementOutput>Output</DataElementOutput>
    </ChartDataPoint>
    </ChartDataPoints>
    <Type>Line</Type>
    <Style />
    <ChartEmptyPoints>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    </ChartEmptyPoints>
    <ValueAxisName>Primary</ValueAxisName>
    <CategoryAxisName>Primary</CategoryAxisName>
    <ChartSmartLabel>
    <CalloutLineColor>Black</CalloutLineColor>
    <MinMovingDistance>0pt</MinMovingDistance>
    </ChartSmartLabel>
    </ChartSeries>
    <ChartSeries Name="Series">
    <ChartDataPoints>
    <ChartDataPoint>
    <ChartDataPointValues>
    <Y>= (Sum(Fields!target.Value, "DataSet2")/ (day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))))*Fields!id.Value</Y>
    </ChartDataPointValues>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <DataElementOutput>Output</DataElementOutput>
    </ChartDataPoint>
    </ChartDataPoints>
    <Type>Line</Type>
    <Style />
    <ChartEmptyPoints>
    <Style />
    <ChartMarker>
    <Style />
    </ChartMarker>
    <ChartDataLabel>
    <Style />
    </ChartDataLabel>
    </ChartEmptyPoints>
    <ValueAxisName>Primary</ValueAxisName>
    <CategoryAxisName>Primary</CategoryAxisName>
    <ChartSmartLabel>
    <CalloutLineColor>Black</CalloutLineColor>
    <MinMovingDistance>0pt</MinMovingDistance>
    </ChartSmartLabel>
    </ChartSeries>
    </ChartSeriesCollection>
    </ChartData>
    <ChartAreas>
    <ChartArea Name="Default">
    <ChartCategoryAxes>
    <ChartAxis Name="Primary">
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    <ChartAxisTitle>
    <Caption>Axis Title</Caption>
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    </ChartAxisTitle>
    <ChartMajorGridLines>
    <Enabled>False</Enabled>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    </Border>
    </Style>
    </ChartMajorGridLines>
    <ChartMinorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    <Style>Dotted</Style>
    </Border>
    </Style>
    </ChartMinorGridLines>
    <ChartMinorTickMarks>
    <Length>0.5</Length>
    </ChartMinorTickMarks>
    <CrossAt>NaN</CrossAt>
    <Minimum>NaN</Minimum>
    <Maximum>NaN</Maximum>
    <ChartAxisScaleBreak>
    <Style />
    </ChartAxisScaleBreak>
    </ChartAxis>
    <ChartAxis Name="Secondary">
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    <ChartAxisTitle>
    <Caption>Axis Title</Caption>
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    </ChartAxisTitle>
    <ChartMajorGridLines>
    <Enabled>False</Enabled>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    </Border>
    </Style>
    </ChartMajorGridLines>
    <ChartMinorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    <Style>Dotted</Style>
    </Border>
    </Style>
    </ChartMinorGridLines>
    <ChartMinorTickMarks>
    <Length>0.5</Length>
    </ChartMinorTickMarks>
    <CrossAt>NaN</CrossAt>
    <Location>Opposite</Location>
    <Minimum>NaN</Minimum>
    <Maximum>NaN</Maximum>
    <ChartAxisScaleBreak>
    <Style />
    </ChartAxisScaleBreak>
    </ChartAxis>
    </ChartCategoryAxes>
    <ChartValueAxes>
    <ChartAxis Name="Primary">
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    <ChartAxisTitle>
    <Caption>Axis Title</Caption>
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    </ChartAxisTitle>
    <ChartMajorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    </Border>
    </Style>
    </ChartMajorGridLines>
    <ChartMinorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    <Style>Dotted</Style>
    </Border>
    </Style>
    </ChartMinorGridLines>
    <ChartMinorTickMarks>
    <Length>0.5</Length>
    </ChartMinorTickMarks>
    <CrossAt>NaN</CrossAt>
    <Minimum>NaN</Minimum>
    <Maximum>NaN</Maximum>
    <ChartAxisScaleBreak>
    <Style />
    </ChartAxisScaleBreak>
    </ChartAxis>
    <ChartAxis Name="Secondary">
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    <ChartAxisTitle>
    <Caption>Axis Title</Caption>
    <Style>
    <FontSize>8pt</FontSize>
    </Style>
    </ChartAxisTitle>
    <ChartMajorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    </Border>
    </Style>
    </ChartMajorGridLines>
    <ChartMinorGridLines>
    <Style>
    <Border>
    <Color>Gainsboro</Color>
    <Style>Dotted</Style>
    </Border>
    </Style>
    </ChartMinorGridLines>
    <ChartMinorTickMarks>
    <Length>0.5</Length>
    </ChartMinorTickMarks>
    <CrossAt>NaN</CrossAt>
    <Location>Opposite</Location>
    <Minimum>NaN</Minimum>
    <Maximum>NaN</Maximum>
    <ChartAxisScaleBreak>
    <Style />
    </ChartAxisScaleBreak>
    </ChartAxis>
    </ChartValueAxes>
    <Style>
    <BackgroundGradientType>None</BackgroundGradientType>
    </Style>
    </ChartArea>
    </ChartAreas>
    <ChartLegends>
    <ChartLegend Name="Default">
    <Style>
    <BackgroundGradientType>None</BackgroundGradientType>
    <FontSize>8pt</FontSize>
    </Style>
    <ChartLegendTitle>
    <Caption />
    <Style>
    <FontSize>8pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <TextAlign>Center</TextAlign>
    </Style>
    </ChartLegendTitle>
    <HeaderSeparatorColor>Black</HeaderSeparatorColor>
    <ColumnSeparatorColor>Black</ColumnSeparatorColor>
    </ChartLegend>
    </ChartLegends>
    <ChartTitles>
    <ChartTitle Name="Default">
    <Caption>Chart Title</Caption>
    <Style>
    <BackgroundGradientType>None</BackgroundGradientType>
    <FontWeight>Bold</FontWeight>
    <TextAlign>General</TextAlign>
    <VerticalAlign>Top</VerticalAlign>
    </Style>
    </ChartTitle>
    </ChartTitles>
    <Palette>BrightPastel</Palette>
    <ChartBorderSkin>
    <Style>
    <BackgroundColor>Gray</BackgroundColor>
    <BackgroundGradientType>None</BackgroundGradientType>
    <Color>White</Color>
    </Style>
    </ChartBorderSkin>
    <ChartNoDataMessage Name="NoDataMessage">
    <Caption>No Data Available</Caption>
    <Style>
    <BackgroundGradientType>None</BackgroundGradientType>
    <TextAlign>General</TextAlign>
    <VerticalAlign>Top</VerticalAlign>
    </Style>
    </ChartNoDataMessage>
    <DataSetName>DataSet3</DataSetName>
    <Top>0.59667in</Top>
    <Left>0.24667in</Left>
    <Height>3.55in</Height>
    <Width>4.53667in</Width>
    <ZIndex>1</ZIndex>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>White</BackgroundColor>
    <BackgroundGradientType>None</BackgroundGradientType>
    </Style>
    </Chart>
    <Textbox Name="Textbox2">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=day(DateAdd("d",-1,DateAdd("M",1,cdate(cstr(Month(First(Fields!workday.Value, "DataSet3")) )+"/01/" + cstr(Year(First(Fields!workday.Value, "DataSet3")))))))</Value>
    <Style />
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>Textbox2</rd:DefaultName>
    <Top>4.33833in</Top>
    <Left>2.21333in</Left>
    <Height>0.25in</Height>
    <Width>1in</Width>
    <ZIndex>2</ZIndex>
    <Style>
    <Border>
    <Style>None</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </ReportItems>
    <Height>4.71333in</Height>
    <Style />
    </Body>
    <Width>5in</Width>
    <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
    </Page>
    <AutoRefresh>0</AutoRefresh>
    <DataSources>
    <DataSource Name="DataSource1">
    <DataSourceReference>DataSource1</DataSourceReference>
    <rd:SecurityType>None</rd:SecurityType>
    <rd:DataSourceID>6abd5341-c043-4ab1-b449-c32e00efc4ac</rd:DataSourceID>
    </DataSource>
    </DataSources>
    <DataSets>
    <DataSet Name="DataSet1">
    <Query>
    <DataSourceName>DataSource1</DataSourceName>
    <CommandText>SELECT 1 ID, 1 MONTH, 50 VALUE
    UNION
    SELECT 1 ID, 2 MONTH, 30 VALUE
    UNION
    SELECT 1 ID, 3 MONTH, 20 VALUE
    UNION
    SELECT 1 ID, 4 MONTH, 10 VALUE
    UNION
    SELECT 1 ID, 5 MONTH, 25 VALUE
    UNION
    SELECT 1 ID, 6 MONTH, 50 VALUE
    UNION
    SELECT 1 ID, 7 MONTH, 10 VALUE
    UNION
    SELECT 1 ID, 8 MONTH, 20 VALUE
    UNION
    SELECT 1 ID, 9 MONTH, 30 VALUE
    UNION
    SELECT 1 ID, 10 MONTH, 40 VALUE
    UNION
    SELECT 1 ID, 11 MONTH, 45 VALUE
    UNION
    SELECT 1 ID, 12 MONTH, 50 VALUE
    UNION
    SELECT 2 ID, 1 MONTH, 25 VALUE
    UNION
    SELECT 2 ID, 2 MONTH, 30 VALUE
    UNION
    SELECT 2 ID, 3 MONTH, 10 VALUE
    UNION
    SELECT 2 ID, 4 MONTH, 30 VALUE
    UNION
    SELECT 2 ID, 5 MONTH, 45 VALUE
    UNION
    SELECT 2 ID, 6 MONTH, 35 VALUE
    UNION
    SELECT 2 ID, 7 MONTH, 10 VALUE
    UNION
    SELECT 2 ID, 8 MONTH, 50 VALUE
    UNION
    SELECT 2 ID, 9 MONTH, 20 VALUE
    UNION
    SELECT 2 ID, 10 MONTH, 14 VALUE
    UNION
    SELECT 2 ID, 11 MONTH, 40 VALUE
    UNION
    SELECT 2 ID, 12 MONTH, 45 VALUE</CommandText>
    <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
    </Query>
    <Fields>
    <Field Name="ID">
    <DataField>ID</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="MONTH">
    <DataField>MONTH</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="VALUE">
    <DataField>VALUE</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    </Fields>
    </DataSet>
    <DataSet Name="DataSet2">
    <Query>
    <DataSourceName>DataSource1</DataSourceName>
    <CommandText>Select 25000 target</CommandText>
    </Query>
    <Fields>
    <Field Name="target">
    <DataField>target</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    </Fields>
    </DataSet>
    <DataSet Name="DataSet3">
    <Query>
    <DataSourceName>DataSource1</DataSourceName>
    <CommandText>
    select 1 id, '03/01/2015' workday , 100 value
    union
    select 2 id, '03/02/2015' workday , 50 value
    union
    select 3 id, '03/03/2015' workday , 400 value
    union
    select 4 id, '03/04/2015' workday , 300 value
    union
    select 5 id, '03/05/2015' workday , 250 value
    union
    select 6 id, '03/06/2015' workday , 200 value
    union
    select 7 id, '03/07/2015' workday , 500 value
    union
    select 8 id, '03/08/2015' workday , 700 value
    union
    select 9 id, '03/09/2015' workday , 50 value
    union
    select 10 id, '03/10/2015' workday , 450 value
    union
    select 11 id, '03/11/2015' workday , 350 value
    union
    select 12 id, '03/12/2015' workday , 100 value
    union
    select 13 id, '03/13/2015' workday , 100 value
    union
    select 14 id, '03/14/2015' workday , 100 value
    union
    select 15 id, '03/15/2015' workday , 200 value
    union
    select 16 id, '03/16/2015' workday , 700 value
    union
    select 17 id, '03/17/2015' workday , 450 value
    union
    select 18 id, '03/18/2015' workday , 100 value
    union
    select 19 id, '03/19/2015' workday , 700 value
    union
    select 20 id, '03/20/2015' workday , 300 value
    union
    select 21 id, '03/21/2015' workday , 100 value
    union
    select 22 id, '03/22/2015' workday , 200 value
    union
    select 23 id, '03/23/2015' workday , 700 value
    union
    select 24 id, '03/24/2015' workday , 100 value
    union
    select 25 id, '03/25/2015' workday , 100 value
    union
    select 26 id, '03/26/2015' workday , 450 value
    union
    select 27 id, '03/27/2015' workday , 200 value
    union
    select 28 id, '03/28/2015' workday , 100 value
    union
    select 29 id, '03/29/2015' workday , 450 value
    union
    select 30 id, '03/30/2015' workday , 300 value
    union
    select 31 id, '03/31/2015' workday , 700 value</CommandText>
    </Query>
    <Fields>
    <Field Name="id">
    <DataField>id</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    <Field Name="workday">
    <DataField>workday</DataField>
    <rd:TypeName>System.String</rd:TypeName>
    </Field>
    <Field Name="value">
    <DataField>value</DataField>
    <rd:TypeName>System.Int32</rd:TypeName>
    </Field>
    </Fields>
    </DataSet>
    </DataSets>
    <Language>en-US</Language>
    <ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
    <rd:ReportUnitType>Inch</rd:ReportUnitType>
    <rd:ReportID>59e8101c-8585-409d-82e7-c6719e928567</rd:ReportID>
    </Report>
    Thanks
    Prasad
    Mark this as Answer if it helps you to proceed on further.

  • SSRS 2008 Line Chart Issue.

    We are facing an issue with SSRS 2008 charts. We have a report which shows dynamic number of series on a line chart. The data values may not exist for all series for
    the same x axis points. We expected SSRS to connect the missing points as average and have set the empty point option to average.
    The issue is that the
    1)     
    lines for interpolated points only appear when we set the color of empty point to say red and not when it is set to automatic. We need the interpolated line in the same auto
    colour as the original line as we will have markers for the data points from the DB and no markers for empty points.
    2)     
    The interpolated lines extend backwards in the series also – we expect it to only fill the gaps and not extend backward or forward.
    Are these issues known and is there a work around for these issues ? We got your name from one of the SSRS community discussions. Could you please connect us with
    the right person if you are not the right contact for this issue ?
    I also got following reply from one of the MS guy, it says
    Hi Akshay,
    The lines should not go backward.  I have seen this happen before and I’ll have to double-check on what that occurs. If you
    are using a Category Axis, make sure you set the sorting to use a Cdate() expression.  I think that might be it ,but I’ll have to double check.
    As far as using the auto-coloring on the series when you have empty points like this, I don’t think that’s possible.  It would require
    a DCR.  You may need to implement something along the lines described in this article  http://msdn.microsoft.com/en-us/library/aa964128(SQL.90).aspx.
    When I tried the suggestions I over come the auto colouring issue and also used CDATE () but lines still extend bacawords. Can anyone suggest what to do it this situation

    Hi AKshay_Jadhav,
    Firstly, I am not sure who is that MS guy you mentioned without the detail name. Based on my understanding to your issue, I think you could utilize the function
    IsNothing in reoprting services to have a check whether the value is null, if it is Null, you should give a average value to this point, if not leave it to be the original value. Of course, you could achieve this in T-SQL. To
    the color and marker, we could type in the expression in both feature to control their display effort.
    Hope this helps.
    Thanks,
    Challen Fu
    Challen Fu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Flash line chart with multiple lines

    Here a newbie with apex...
    Created a flash line chart with as source the following sql statement:
    select null link, year, sum(total_cost) from cost
    group by year
    a chart has been created with a single line. i wanted every year on an own line.
    The way i could do this is with multiple series like:
    select null link, year, sum(total_cost) from cost
    where year =2008
    select null link, year, sum(total_cost) from cost
    where year =2009
    But this not a good solition, cause now i've to add every year a new serie
    hope to get some help from here... txn in advanced.

    tnx for your reply...
    I will explain myself more by a picture of the wanted result, see below:
    [Click here for the example image|http://img44.imageshack.us/img44/3444/grapha.jpg]
    In your reply you wright you think i can create the graph with pl/sql process. After seeing my example you still think that's needed?
    Hope you or some else can help... tnx in advanced.
    greetings

  • Help - SVG Line Chart - ORA-20001 line_chart error Parse error ORA-00911

    Gurus,
    Need help.
    I am trying to plat multiple series in a SVG line chart but am repeatedly getting line_chart error eventhough SQL queries work perfectly in sql workshop/sqlplus etc. How do I get past this error.
    Sample queries I am using to plot line chart are
    select link, col1, value from (select null link, col1, col2 value from xy);
    select link, col1, value from (select null link, col1, col3 value from xy);
    xy is a table with three number columns col1, col2 & col3.
    Thanks in advance

    Try taking the semicolon ";" off the end of the SELECT statements.
    Mike

  • How to display a goal line in a Flash 2D Line Chart?

    Hello,
    I am using Apex 3.0.1 and have a Flash 2d Line Chart displaying a ratio that varies from 1.0 to 1.6 for every month for a year. I need to draw a goal line at 1.2 to show the goal for the ratio. Also, I have grid lines enabled for the y-axis.
    Any pointers/tips on how to accomplish displaying this goal line would be really useful.
    Thanks and Regards,
    Dev

    I'm having the same problem!
    APEX is relatively new to me. CUSTOM XML for tweaking charts is even more recent. I tried to get a goal line to work in a line chart as you described but I have had no success. I really require a target/goal/reference line in a vertical bar chart but getting it to work in a line chart would be a welcome first step.
    I have tried the following 2 samples of code without success:
    <objects>
    <line value='94' text='Target' text_position='right' color='0xFF3300' size='1' alpha='100'/>
    </objects>
    and
    <objects>
    <trend start_value='94' end_value='94' start_argument='' end_argument='' value='' color='0xFF3300' thickness='1' alpha='100'/>
    </objects>
    ==> in the following blocks of the CUSTOM XML:
    <chart .....</chart>
    <chart..<line_chart .....</line_chart>..</chart>
    <workspace> .. <chart_area .....</chart_area> ..</workspace>
    <workspace> .. <y_axis .....</y_axis> ..</workspace>
    <workspace> .. <grid> ..<values .....</values ..</grid> ..</workspace>
    <workspace> .. <grid> .....</grid> ..</workspace>
    Any idea where I am going wrong or what could be missing? Maybe I'm not putting the <objects> parameters in the correct place in the code?
    System Info:
    Product Build: 3.0.1.00.07
    NLS_CHARACTERSET: WE8MSWIN1252
    DAD CHARACTERSET: UTF-8
    JOB_QUEUE_PROCESSES: 10
    Database Version Information
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE 10.2.0.3.0 Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Thanks for any help!
    Lawrence

  • Flash 2D Line chart

    I have a chart region - Flash 2D Line chart with two series based on different tables, both with dates along the X axis
    and a figure that represents hours up the Y axis. The idea is for two lines to be displayed on the same graph so they can be
    easily compared.
    series 1
    select null link, END_DATE label, PROJECTED_HOURS Projected_hours
    from "E_LOGBOOK"."TEST_PROJECTED"
    30/07/2009 700
    09/08/2009 800
    27/08/2009 9000
    series 2
    select null link, LIFING_DATE label, ACTUAL_HOURS Current_Hours
    from "E_LOGBOOK"."TEST_ACTUAL"
    30/07/2009 800
    09/08/2009 1000
    27/08/2009 12000
    When I run the chart with the data above it displays as I would expect, the dates label in chronological order along the bottom with the Correct value plotted for each series.
    However if I insert a row into the LIFING_DATE table (second series) so it contains additional data for the 14/08/2009
    30/07/2009 800
    09/08/2009 1000
    14/08/2009 1201
    27/08/2009 12000
    And then re run the chart this last date and value displays to the right of the existing dates so we have 30/07/2009 09/08/2009 27/08/2009 then 14/08/2009 along the X axis.
    I would have expected the new data to fit in the existing range so that 30/07/2009 09/08/2009 14/08/2009 27/08/2009 would display along the bottom.
    I am an oracle forms programmer new to APEX (and html, javascript,XML etc) trying to prepare a demo to my manager of what we can do with apex so any help appreciated.
    If possible is there a solution without using Third party apps or bi publisher.
    Thanks Pete

    Hi Andy,
    Thanks for your quick response. If I'm correct in understanding what your saying is that with 2D Line charts that have two series in order for them to display togethor then the label must appear in both series.
    I've had a bash using your sql for the 1st series and modifying the second series.
    Series 1
    SELECT NULL LINK,
    X.THE_DATE LABEL,
    Y.PROJECTED_HOURS VALUE
    FROM
    (SELECT END_DATE THE_DATE FROM TEST_PROJECTED
    UNION
    SELECT LIFING_DATE THE_DATE FROM TEST_ACTUAL
    ) X
    LEFT OUTER JOIN TEST_PROJECTED Y ON X.THE_DATE = Y.END_DATE
    ORDER BY X.THE_DATE
    07/30/2009 700
    08/09/2009 800
    08/14/2009
    08/27/2009 9000
    Series 2
    SELECT NULL LINK,
    X.THE_DATE LABEL,
    Y.ACTUAL_HOURS VALUE
    FROM
    (SELECT END_DATE THE_DATE FROM TEST_PROJECTED
    UNION
    SELECT LIFING_DATE THE_DATE FROM TEST_ACTUAL
    ) X
    LEFT OUTER JOIN TEST_ACTUAL Y ON X.THE_DATE = Y.LIFING_DATE
    ORDER BY X.THE_DATE
    07/30/2009 800
    08/09/2009 1000
    08/14/2009 1201
    08/27/2009 12000
    This is a great improvement the series 2 now displays fine and all the points for series 1 are plotted correctly but it seems like the null value prevents the joining of the coordinates in this series. All the points 700,800 and 9000 are displayed correctly but the graph line only joins 700 and 800.
    Any further ideas? Thanks Pete

Maybe you are looking for