Create Dynamic Chart from sql / plsql

Hi can anybody help with this problem. I need to know the process I can use to create a dynamic pie chart from plsql.
i.e. the functionality is -> user selects a table, then selects a subset of columns and then generates a pie chart of these columns.
I cannot find a way of generating the pie chart sql syntax on the fly. Can anybody do this?

See: Re: SVG Charts - How to use dynamic tables in select statement

Similar Messages

  • Chart from SQL Colour

    I am creating reports in information publisher and wish to include charts from SQL to summarise the data. As some of these reports will include job execution status and similar status fields it would be useful to show Failures in Red and Successes in Green like the "All Targets Status" region on the Enterprise Manager Grid Control home page.
    Is there any way I can influence the colour that items are plotted in Pie and other Charts? I am using release Oracle Enterprise Manager 10g Grid Control Release 10.2.0.1.0.
    Thanks in advance for any help you can offer.
    Regards,
    Matthew

    Hi Siegwin,
    Although the data section of your generated chart XML contains references to styles, such as CadetBlue2, yellow, etc, you haven't actually defined those styles within the <period_styles> tags of the XML. Therefore, the chart will apply the default blue colour to each timeline of the chart. You'll see that there's a default style called defaultStyle already generated for you in the XML i.e. <period_style name="defaultStyle"> What you need to do is create your own styles, mirroring the defaultStyle example, in order to apply other colours to your gantt chart. I've updated your XML to include a new yellow style, so you can see that one of the elements of the chart now picks up that colour.
    My sample chart, Resource Gantt with Custom Styles, should hopefully help to explain what you need to do in order to apply custom colours to your chart: http://apex.oracle.com/pls/apex/f?p=36648:60
    I hope this helps.
    Regards,
    Hilary

  • Need help in creating a chart from 3 datasets

    Need help in creating a chart in SSRS from 3 datasets
    Can someone help me in creating a chart from 3 datasets, however datasource is same.

    Thank you Olaf...
    could anyone help me in using union all with the below
     WITH a AS (
    SELECT
    clientid,
    DATEPART(year, row_date) AS 'Year',
    DATEPART(month, row_date) AS 'Month',
        value ,
        CASE metricid WHEN 16 THEN 'FCR' ELSE 'Cases' END AS metric
    FROM XXXXXX AS V
    WHERE metricid IN (16, 11)
    AND row_date BETWEEN '2012-01-01' AND '2014-10-01'
    AND value IS NOT NULL)
    , b AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'Cases',
        metric 
    FROM a
    WHERE metric = 'cases')
    , c AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'FCR',
        metric  
    FROM a
    WHERE metric = 'FCR')
    , d AS (
    SELECT b.YEAR, b.MONTH, c.FCR, b.Cases 
    FROM b INNER JOIN c 
    ON c.clientid = b.clientid
    AND c.[YEAR] = b.[year] 
    AND c.[month] = b.[month]
    WHERE c.fcr <> 0 AND b.cases <> 0
    ,E AS (
    SELECT [Year], [Month], SUM(FCR) AS FCR, SUM(Cases) AS Cases
    FROM d
    GROUP BY [Year], [Month])
    select YEAR, MONTH, 
    CASE MONTH 
    WHEN 1 THEN 'Jan'
    WHEN 2 THEN 'Feb'
    WHEN 3 THEN 'Mar'
    WHEN 4 THEN 'Apr'
    WHEN 5 THEN 'May'
    WHEN 6 THEN 'Jun'
    WHEN 7 THEN 'Jul'
    WHEN 8 THEN 'Aug'
    WHEN 9 THEN 'Sep'
    WHEN 10 THEN 'Oct'
    WHEN 11 THEN 'Nov'
    WHEN 12 THEN 'Dec'
    END AS MonthName
    ,e.FCR AS FCRCases
    ,e.Cases AS TotalCases
    ,CASE 
    WHEN [month] IN (11, 12, 1) THEN 1
    WHEN [month] IN (2, 3, 4) THEN 2
    WHEN [month] IN (5, 6, 7) THEN 3
    WHEN [month] IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    --,CONVERT(DECIMAL(18, 2),(e.FCR/e.Cases)*100) AS FCRRaw
    from e
    order by YEAR, MONTH
    **************2nd query*************
    WITH a AS (
    SELECT
    clientid,
    DATEPART(year, row_date) AS 'Year',
    DATEPART(month, row_date) AS 'Month',
        value, 
        CASE metricid WHEN 56 THEN 'numerator' ELSE 'denominator' END AS metric
    FROM XXXXXXX.[Values] AS V
    WHERE metricid IN (56, 10)
    --WHERE metricid IN (11,16)
    AND row_date BETWEEN '2013-10-01' AND '2014-02-01'
    AND value IS NOT NULL)
    , b AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'numerator',
        metric
    FROM a
    WHERE metric = 'numerator')
    , c AS (
    SELECT     clientid ,
        Year ,
        Month ,
        value AS 'denominator',
        metric
    FROM a
    WHERE metric = 'denominator')
    , d AS (
    SELECT b.YEAR, b.MONTH, c.denominator, b.numerator 
    FROM b INNER JOIN c 
    ON c.clientid = b.clientid
    AND c.[YEAR] = b.[year] 
    AND c.[month] = b.[month]
    WHERE c.denominator <> 0 AND b.numerator <> 0
    , e AS (
    SELECT [Year], [Month], SUM(numerator) AS numerator, SUM(denominator) AS denominator
    FROM d
    GROUP BY [Year], [Month]
    SELECT *, 
    CASE 
    WHEN [month] IN (11, 12, 1) THEN 1
    WHEN [month] IN (2, 3, 4) THEN 2
    WHEN [month] IN (5, 6, 7) THEN 3
    WHEN [month] IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    FROM e
    ORDER BY 1,2
    ******************3rd query**************
    WITH a AS (
    SELECT --L.[LocationGroupId],
    -- T.locationid,
    -- T.AccountId,
    TR.datestamp,
    /*Convert(NVARCHAR, DatePArt(year, TR.datestamp)) + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01'*/ 
    TR.Period AS ValueDate,
    CASE WHEN TR.TargetResultState = 0 THEN 0 WHEN TR.TargetResultState = 1 THEN 1 WHEN TR.TargetResultState = 2 THEN 1 ELSE 0 END AS Met,
    CASE WHEN CONVERT(DATE, Convert(NVARCHAR, DatePArt(year, TR.datestamp)) + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01') > T.Startdate AND CONVERT(DATE, Convert(NVARCHAR, DatePArt(year, TR.datestamp))
    + '-' + Convert(NVARCHAR, DatePArt(month, TR.datestamp)) + '-01') < T.Enddate THEN 1 ELSE 0 END AS ActiveTarget
    FROM XXXXXX AS TR
    INNER JOIN dbo.Target T ON TR.TargetID = T.ID
    --INNER JOIN dbo.Location L ON T.Locationid = L.Id
    WHERE --locationid <> - 1 AND 
    TR.Period IN ('201306', '201307', '201308', '201309', '201310', '201311', '201312', '201401'))
    select ValueDate, SUM(Met) AS Met, Count(ActiveTarget) AS ActiveTargets,
    right(ValueDate,2) as Month
    ,left(ValueDate,4) as Year
    ,CASE 
    WHEN right(ValueDate,2) IN (11, 12, 1) THEN 1
    WHEN right(ValueDate,2) IN (2, 3, 4) THEN 2
    WHEN right(ValueDate,2) IN (5, 6, 7) THEN 3
    WHEN right(ValueDate,2) IN (8, 9, 10) THEN 4
    END AS 'Quarter'
    from a
    group by ValueDate
    order by ValueDate

  • 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

  • Create oracle table from sql server

    Dear Gurus,
    I need to create some tables from sql server 2008 to a oracle 11g database. Some tables contain vbinary datatype. Now my queries are
    1. How can I do that?
    2. If DB link is a solution then would you please provide me a step by step process to do so?
    3. Is there any issue with datatype?
    SQL Server db is on windows 2008 R2
    Oracle is in RHEL 5.5
    Will appreciate ur help.

    well suppose i generate flat files from sql server and load in oracle by sqlloader then will there be any issue with vbinary datatype? what should be the equivalent data type in oracle table?

  • How to create chord charts from midi using logic pro x

    How to create chord charts from midi using logic pro x

    Depending on what you mean by Chord charts (Tabs?)
    Use the Score.......
    http://help.apple.com/logicpro/mac/10/#lgcpf755d649

  • [DW + PHP + MySQL] is there an extension to create dynamic charts?

    Hi all
    is there an extension for DW (I have DW 8) that let you
    create dynamic
    chart based on a mysql database?
    Once upon a time there was an interakt extension that was
    created just
    for this kind of applications, but now it is discontinued
    (thanks
    adobe) and I can't even buy it.
    Is there an alternative?
    Thanks in advance.
    tony

    Check
    http://www.webassist.com. They
    have one.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "sweetman" <[email protected]> wrote in message
    news:[email protected]..
    > Hi all
    >
    > is there an extension for DW (I have DW 8) that let you
    create dynamic
    > chart based on a mysql database?
    >
    > Once upon a time there was an interakt extension that
    was created just
    > for this kind of applications, but now it is
    discontinued (thanks
    > adobe) and I can't even buy it.
    >
    > Is there an alternative?
    >
    > Thanks in advance.
    >
    > tony

  • Make Dynamic Form from sql query

    Hi... i'm trying to create a VO with sql query, but the attributes for this Vo are should made from rows from sql query not from columns, how i can do this?
    example
    NOMCAMPODATOS -- ORDENBLKWEB
    PLANMINFIANZAS --
    SERIEID -- 5
    CODREMOLQUE -- 4
    CODFORMPAGO -- 24
    CODCIUDAD -- 13
    DIREC -- 10
    EMAIL -- 17
    FECFINVIG -- 20
    VO example
    attributes:
    PLANMDIANZAS NUMBER
    SERIEID NUMBER
    CODREMOLQUE NUMBER
    ETC..
    Edited by: JLopezJujuy on 18-dic-2012 10:01

    Try a PIVOT operator in your SELECT command, or one of the other ways to turn rows into columns. Look in the SQL manual for more information, or ask in the SQL and PL/SQL forum.
    By the way, this doesn't sound like a very good database design. Have a look at this "Ask Tom" thread for a discussion about what is wrong with it - http://asktom.oracle.com/pls/apex/f?p=100:11:0::NO::P11_QUESTION_ID:10678084117056

  • How to create analytic privileges from sql command line in hana studio?

    I want to create a bunch of analytic privileges, activate them and assign it a roles. I was wondering if there is a method where I can create these analytical privileges directly from sql?

    Hi Krishna,
    Thanks for the reply.
    The use case is to create a bulk analytical privileges on the pre-existing analytical or calculation views and I'm failing to create it using the simple CREATE STRUCTURED PRIVILEGE.
    The security guide shows below mentioned as the syntax but I'm failing to create it through that:
    CREATE STRUCTURED PRIVILEGE AP_SALES_1 FOR SELECT ON TABLEOWNER.VIEW_SALES WHERE REGION IN ('DE','UK') OR PRODUCT = 'CAR';
    It gives me this error -
    SAP DBTech JDBC: [257] (at 44): sql syntax error: incorrect syntax near "FOR": line 1 col 44 (at pos 44)

  • Creating dynamic illustrations from spreadsheet

    Hi,
    I am currently working on a research project which involves creating dynamic graphics.
    My research involves the creation of a graphic diagram from spreadsheets/databases. But the output requires to be dynamic. E.g change the spreadsheet it changes the graphic.
    I am basically want to create my own graphs. But I don't want to use the illustrator graph wiz.
    I wondered if you had any suggestions of how to go about this? I have been looking into programing and plugins but nothing has come up so far. Can you help?
    Hope you can help!
    Ian Carr

    All i want to do is give shapes a vialue and that value
    corresponds to size colour and where it's placed on the page.
    What you describe can certainly be done with AI Javascript. But...
    My research involves the creation of a graphic diagram from spreadsheets/databases. But the output requires to be dynamic. E.g change the spreadsheet it changes the graphic.
    ...depends upon what exactly you mean by "dynamic; change the spreadsheet, it changes the graphic."
    With AI Javascript, you can:
    Parse values out of delimited text.
    Use those values to manipulate size, position, and color of objects.
    Assign Notes to objects, or send them to a Layer (or possibly use other mechanisms whereby to give them a "handle" by which to identify them again the next time you edit the values and rerun the script).
    So if by "dynamic" you mean to have the graph effectively "re-plot" itself upon demand after editing the values, yes.
    But if by "dynamic" you mean to watch individual objects move as you edit individual values in real time, without re-running the script, no. (That could be done in Flash.)
    JET

  • Creating dynamically JTree from database values

    Hi,
    I have a local database with some node values. I receive these values from database as a String[].
    short example:
    String[] Values = {"mainNode","Processors","mainNode","RAM","mainNode","Monitors",
    "Processors","INTEL","Processors","AMD","RAM","Kingston","RAM","GoodRAM",
    "Kingston","400MHz","Kingston","433MHz"}First value is higher node, second is a child.
    I'd like to produce dynamically JTree from Values[] like below:
    MainNode
    |----Processors
          |----INTEL
          |----AMD
    |----RAM
          |----Kingston
                |----400MHz
                |----433MHz
          |----GoodRam
    |----MonitorsI can't build up any working and fast solution :(
    Can anyone help me ?
    Please for any advices (samples) which will help me to apply it.
    Dearly regards!

    This is a relatively straight forward task but it smacks of being homework so unless you post what you have already done you are unlikely to be given any code.
    As a hint -
    Go through the data creating a Map between the parent value and a child DefaultMutableTreeNode which contains as user object the child String.
    When you extract a parent String from the data lookup the parent DefaultMutableTreeNode in the map and add the child DefaultMutableTreeNode to the parent DefaultMutableTreeNode.
    Note - All the map is doing is giving you a quick way of looking up a DefaultMutableTreeNode given a parent name.
    Note - that your tree will have problems if the same value appears in two or more branches!

  • Create a chart from subtotals

    I have a daily expense register with 4 columns: date, amount, type of expense, and description. The table is categorised by the expense type column. I have inserted subtotals based on the amount column. I am trying to create a chart that shows the percentages of each expense type (e.g. groceries 35%, petrol 20%, etc.)
    These are sample entries:
    28/5/10 35.00 Groceries [Description]
    28/5/10 42.00 Petrol
    29/5/10 12.00 Dry cleaning
    29/5/10 38.00 Groceries
    When I add categorisation feature, I get:
    Groceries (Subtotal: 73.00)
    28/5/10 35.00
    29/5/10 38.00
    Petrol (Subtotal: 42.00)
    28/5/10 42.00
    Dry cleaning (Subtotal: 12.00)
    29/5/10 12.00
    I want to see a pie chart based on the categories Groceries, Petrol, +Dry cleaning+ and the amounts 73.00, 42.00, and 12.00.
    Could someone please advise how to do this? I can only create a pie chart with the individual transactions which is pointless since there are hundreds of entries.

    Hi c,
    "Table 1" is the default name given to the first table on a sheet. As you've changed the name of that table to "Spending Journal", the formula in B2 of the Summary table should read:
    =SUMIF(Spending Journal::Category,A2,Amount)
    Fill the formula down for as many categories as you have.
    List the categories in column A, starting in A2. They may be listed in any order, but each must be exactly the same as one of the categories in the popup list.
    I don't understand how to refer to a specific item in the (popup) list and then how to put that in a condition statement.
    From the iWork functions and Formulas User Guide,
    SUMIF
    The SUMIF function returns the sum of a collection of numbers, including only numbers that satisfy a specified condition.
       SUMIF(test-values, condition, sum-values)
    • test-values:  The collection containing the values to be tested. test-values is a collection containing any value type.
    •condition:  An expression that results in a logical TRUE or FALSE. condition is an expression that can contain anything as long as the result from comparing condition to a value in test-values can be expressed as a Boolean value of TRUE or FALSE.
    • sum-values:  An optional collection containing the numbers to be summed. sumvalues is a collection containing number, date/time, or duration values. It should have the same dimensions as test-values.
    For your case:
    test-values: the values in the "Category" column of the "Spending Journal" table.
    condition:   the value in cell A2 (of the summary table, the table containing the formula)
    sum-values: the values in the Amounts column (of the "Spending Journal" table)
    Numbers displays both the table name and the column name in the first reference as the document contains two columns named "Category".
    The table is not named in the second reference as the formula is on the same table as the referenced cell.
    And the table is not named in the third reference as the document contains only one column named "Amount".
    Regards,
    Barry
    PS: If you're expecting to work with other functions or formulas you should, if you haven't already, download the iWork Functionns and Formulas User Guide, available through the Application menu in any of the iWork applications.
    B

  • Creating a chart from cells formatted as duration

    Apparently, iWork 09 can't create a chart when the cells being referenced to it are formatted as duration. Well, the chart is sorta there, but none of the data shows.
    !http://www.michelle.org/pictures/example.jpg!

    http://discussions.apple.com/thread.jspa?messageID=9290014&#9290014
    The scatter chart is the only one that understands durations. Otherwise you'll have to decimalize your durations. I am hopeful this will be corrected in a patch, not wait until the next version.

  • Creating dynamic database connection (SQL server 2008) from Adf application

    Hello,
    I am creating an ADF Fusion Application. I use Jdev. 11.1.2.3.0 , WebLogic 10.3 and MS SQL server 2008 database. My question is that how can I create a database connection configuration file, now I connect to the database through hard coding, there should be a way to do this with sql server I think.
    my database name is : testDatabase
    my database username is : testUser
    my database password is : testPassword
    Anybody can help me please.
    Thanks,
    Shahe

    Hello Frank,
    The database schema is the same for all the users, but the location of the database differs, for example: I have set the hostname of the database to localhost because the database is installed on the local pc, but to other clients the database is installed on a managed server so in the hostname I should put the server's ip address or name. So I need an external file where I can set these options.
    Thanks,
    Shahe

  • How to Generate Dynamic Columns from SQL

    Hi Friends,
    I want to create a data fromat like This
    Showroom / date    01-01-09        02-01-09     03-01-09     04-01-09      05-01-09     06-01-09     07-01-09   
    S1                           20                      10              09            90             90                  10            100
    S2                           10                       1                1              2               6                    2             10
    S3                            5                        7                 9             1               2                    3             12This Data is Just like Matriz Reports....................................
    Here i Want to Generate Date column value Dynamically.....................is it possible through SQL
    the values are Sales value for each showroom for diffrent date value
    all sale,showroom and Date Column are in one Table......................
    It should Generate date Dynamically depending on User VAlues./..............
    Thanks in Advance

    something to play with (not tested as I don't have database access)
    declare
    /* assuming table showroom_sales has columns a_showroom,a_date,a_sale */
      the_sql varchar2(32000) := 'select a_showroom';
      day_from date := to_date('20090101','yyyymmdd');
      day_till date := to_date('20090107','yyyymmdd');
    begin
      for d in (select a_date from showroom_sales where a_date between day_from and day_till)
      loop
        the_sql := the_sql ||
                   ',max(decode(a_date,to_date('''||to_char(d.a_date,'yyyymmdd')||''',''yyyymmdd''),a_sale,null)) "'||to_char(d.a_date,'dd-mm-rr')||'"'
      end loop;
      the_sql := the_sql || ' from showroom_sales group by a_showroom order by a_showroom ';
      dbms_output.put_line(the_sql);  /* to verify if query is correct or not */
    end;the code above should generate something like (provided all those dates appear in your showroom_sales table)
    select a_showroom,
           max(decode(a_date,to_date('20090101','yyyymmdd'),a_sale,null)) "01-01-09",
           max(decode(a_date,to_date('20090102','yyyymmdd'),a_sale,null)) "02-01-09",
           max(decode(a_date,to_date('20090103','yyyymmdd'),a_sale,null)) "03-01-09",
           max(decode(a_date,to_date('20090104','yyyymmdd'),a_sale,null)) "04-01-09",
           max(decode(a_date,to_date('20090105','yyyymmdd'),a_sale,null)) "05-01-09",
           max(decode(a_date,to_date('20090106','yyyymmdd'),a_sale,null)) "06-01-09",
           max(decode(a_date,to_date('20090107','yyyymmdd'),a_sale,null)) "07-01-09"
      from showroom_sales
    group by a_showroom
    order by a_showroom to be executed to get the result as required
    Regards
    Etbin

Maybe you are looking for