Problems in creating a chart..

Hi,
I have Problems in creating the following chart..
I dont know where the problem of the Publisher is, because the same structers already shows me a Table full of Data...
I ve tested something and realized when i m deleting the SUM() Part everything works fine. Ist it maybe an error in the sum function?
its such a simple statement but it wont work...
XML Code:
chart:
<Graph graphType="PIE">
<Title text="" visible="true" horizontalAlignment="CENTER"/>
<LocalGridData rowCount="{count(xdoxslt:group(DATA/query_DATA/ROW, CURRENY))}" colCount="1">
<RowLabels>
<xsl:for-each-group select="DATA/query_DATA/ROW" group-by="CURRENCY">
<xsl:sort select="CURRENCY"/>
<Label>
<xsl:value-of select="current-group()/CURRENCY"/>
</Label>
</xsl:for-each-group>
</RowLabels>
<DataValues>
<xsl:for-each-group select="DATA/query_DATA/ROW" group-by="CURRENCY">
<xsl:sort select="CURRENCY"/>
<RowData>
<Cell>
<xsl:value-of select="sum(current-group()/PRICE)"/>
</Cell>
</RowData>
</xsl:for-each-group>
</DataValues>
</LocalGridData>
</Graph>
Greeting

It doesnt work, because i deleted the ' while chaning the caption to currency....
OK here is my original Text....
chart:
<Graph graphType="PIE">
<Title text="" visible="true" horizontalAlignment="CENTER"/>
<LocalGridData rowCount="{count(xdoxslt:group(DATA/query_DATA/ROW, 'POS_EURO_TXT'))}" colCount="1">
<RowLabels>
<xsl:for-each-group select="DATA/query_DATA/ROW" group-by="POS_EURO_TXT">
<xsl:sort select="POS_EURO_TXT"/>
<Label><xsl:value-of select="current-group()/POS_EURO_TXT"/></Label>
</xsl:for-each-group>
</RowLabels>
<DataValues>
<xsl:for-each-group select="DATA/query_DATA/ROW" group-by="POS_EURO_TXT">
<xsl:sort select="POS_EURO_TXT"/>
<RowData>
<Cell><xsl:value-of select="sum(current-group()/NET)"/></Cell>
</RowData>
</xsl:for-each-group> </DataValues>
</LocalGridData>
</Graph>
<DATA>
<query_DATA><ROW>
<KUNGRUPPE>ABC</KUNGRUPPE>
<POS_EURO_TXT>USD</POS_EURO_TXT>
<NET>7785763.25</NET>
</ROW><ROW>
<KUNGRUPPE>ABC</KUNGRUPPE>
<POS_EURO_TXT>EURO</POS_EURO_TXT>
<NET>15242332211.9</NET>
</ROW><ROW>
<KUNGRUPPE>XXX</KUNGRUPPE>
<POS_EURO_TXT>EURO</POS_EURO_TXT>
<NET>7894268.84</NET>
</ROW></query_DATA>
</DATA>
Greetings

Similar Messages

  • Problem creating pie-chart

    Post Author: ujain82
    CA Forum: Desktop Intelligence Reporting
    Hello,      I am using BO 6.1
    I am having trouble creating pie chart. I am calculating different count values from different data providers. Now I need to create a pie chart showing the proportion for each count as I can find the percentage of count.
    My scenario(task):I need count on persons depending on searching on complaint text. So for each search I have a data providers. Like this I am searching for 8 criteria. So I have different data providers for each search. I get person counts from each criteria.
    Now I want to show it in a pie chart. But I could not make it done.Does anyone faced a similar problem? How do I solve my problem?
    Any comments?

    Attached is part of the sub-vi where I am having the problem. I tell Excel which cells to use for the pie chart. If I use "Source 1" (8 cells) the pie chart is created successfully. If I use "Source 2" (14 cells) the pie chart only uses the first cell. I can go to the Excel file and select all 14 cells manually and the pie chart displays correctly. I also tried 9 cells with no luck, it seems that 8 cells are the limit. I am trying to find what is causing the limitation. I have also attached the sub-vi. 
    Attachments:
    Pie chart block diagram.JPG ‏61 KB
    M-51539-001 Create Pie Chart.vi ‏108 KB

  • Problem creating line chart with character data

    Post Author: burkartt
    CA Forum: Charts and Graphs
    CR Developer v. 11.5.0.313
    I want to create a line chart with data from a SQL2K table to show how much server time each application uses per day. All data is defined a character.
    HWA,4/24/2007,01:44.6HWA,4/25/2007,12.28HWB,4/24/2007,4.6HWC,4/24/2007,55.55HWC,4/25/2007,01:22.3HWE,4/24/2007,01:16.1HWE,4/25/2007,0.59
    I want one horizontal line per application where the X-axis represents the date and the Y-axis represents the server time. I have tried all column combinations for "On Change Of" and "Show Value(s)". What confuses me is why are Count and Discount the only Summary Options for the "Show Value(s)" data?
    Thank you,
    tim

    Post Author: V361
    CA Forum: Charts and Graphs
    I created a group based on date, day, then created the chart and put it in the group footer, on change of server, show sum of time, you will get a seperate chart for each day.  I am not sure if this will help, or will just do.  Since you have CR XI, you may want to look at the gauge chart also....

  • Problem in creating a JDBC System on VC7.1 portal ( CE7.1 SP3)

    I have a problem in creating a JDBC System on VC7.1 portal (CE7.1 SP3)
    I get the following error:
    Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the back-end application using the connector defined in this system object
    Results
    Default alias retrieved successfully
    Connection failed. Make sure user mapping is set correctly and all connection properties are correct.
    Could you please let me know if there are any guides on SAP Library; I was not able to find any documentation nor any threads discussing this on VC7.1
    Although, I saw this thread Can Visual Composer talk to/connect to any Database?..
    which says that VC7.1 can connect to SAP backend
    and web services only, and there is no direct connection to the db.
    Help needed please.

    Hi Dharmi
    Here is a quote of Dafna's post in [another thread in this forum|Re: Copy VC controls]
    CE7.1.1 will be released at September 2008 for ramp-up customers.
    There are many improvements and new capabilities in the new release of Visual Composer for CE7.1.1. Among the new features you can find:
    The missing features from Visual Composer 7.0 (Html view, portal Eventing support (EPCM), JDBC, Undo/Redo, and more..)
    Many layout & modeling improvements
    Additional ALV table functionality - export to Excel, switch to chart, configure ALV behavior at design time
    Integration of Visual Composer in Eclipse - additional entry point to the Visual Composer models from the NWDS. This integration provides the option to add a WD component (in case of missing functionality in Visual Composer), as a black box component to the Visual Composer model. Right-clicking the component will open the Web Dynpro perspective for creating/modifying the component.
    Regards,
       Shai

  • Trouble creating pie-chart

    Post Author: ujain82
    CA Forum: WebIntelligence Reporting
    Hello,      I am having trouble creating pie chart. I am calculating different count values from different data providers. Now I need to create a pie chart showing the proportion for each count as I can find the percentage of count.
    My scenario(task):I need count on persons depending on searching on complaint text. So for each search I have a data providers. Like this I am searching for 8 criteria. So I have different data providers for each search. I get person counts from each criteria.
    Now I want to show it in a pie chart. But I could not make it done.Does anyone faced a similar problem? How do I solve my problem?
    Any comments?

    Post Author: Chris Chen
    CA Forum: WebIntelligence Reporting
    Hi ujain82,
    Because you have some data provider,so some metric may have no conjunction,i suggest that you creat variables to reuse them.

  • Legend Problem in multiple series chart

    Hello,
    I am getting problem in displaying legend. I have created a chart with  multiple series and custon color. Here is my code. You can copy paste it.
    Out of 3 only one legend marker n label coming.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#FFFFFF, #FFFFFF]">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
          [Bindable]
          public var SMITH:ArrayCollection = new ArrayCollection([
            {date:"22-Aug-05", close:41.87, close2:45.23},
            {date:"23-Aug-05", close:45.74, close2:40.90},
            {date:"24-Aug-05", close:42.77, close2:46.99},
            {date:"25-Aug-05", close:48.06, close2:40.22},
         [Bindable]
          public var DECKER:ArrayCollection = new ArrayCollection([
            {date:"22-Aug-05", close:157.59},
            {date:"23-Aug-05", close:160.3},
            {date:"24-Aug-05", close:150.71},
            {date:"25-Aug-05", close:156.88},
        ]]>
    </mx:Script>
      <mx:Style>
        ColumnChart {
            paddingLeft:20;
            paddingRight:20;
            paddingBottom:10;
            paddingTop:10;
         Legend {
         paddingLeft:20;
            paddingRight:20;
            paddingBottom:20;
            paddingTop:10;
      </mx:Style>
          <mx:Stroke id="axisStroke"
            color="#000000"
            weight="2"
            alpha=".75"
            caps="round"
        />
    <mx:VBox width="500" height="500" borderColor="#000000" cornerRadius="20" themeColor="#009DFF" borderStyle="solid" borderThickness="1" horizontalAlign="center" x="246.5" y="61">
         <mx:ColumnChart id="multipleChart"  showDataTips="true" width="100%" height="100%"  seriesFilters="[]">
            <mx:horizontalAxis>
               <mx:CategoryAxis id="h1" categoryField="date"/>
            </mx:horizontalAxis>
            <mx:horizontalAxisRenderers>
                <mx:AxisRenderer placement="bottom" axis="{h1}">
                <mx:axisStroke>{axisStroke}</mx:axisStroke>
                </mx:AxisRenderer>
            </mx:horizontalAxisRenderers>
            <mx:verticalAxisRenderers>
                <mx:AxisRenderer placement="left" axis="{v1}"><mx:axisStroke>{axisStroke}</mx:axisStroke></mx:AxisRenderer>
                <mx:AxisRenderer placement="right" axis="{v2}"><mx:axisStroke>{axisStroke}</mx:axisStroke></mx:AxisRenderer>
            </mx:verticalAxisRenderers>
            <mx:series>
               <mx:ColumnSeries id="cs1" horizontalAxis="{h1}" dataProvider="{SMITH}" xField="date" yField="close" displayName="Smith" fills="#6693B0">
                    <mx:verticalAxis>
                       <mx:LinearAxis id="v1" minimum="40" maximum="50"/>
                    </mx:verticalAxis>
               </mx:ColumnSeries>
               <mx:ColumnSeries id="cs3" horizontalAxis="{h1}" dataProvider="{SMITH}" xField="date" yField="close2" displayName="Smiths" fills="#86D1E4">
               </mx:ColumnSeries>          
               <mx:LineSeries id="cs2" horizontalAxis="{h1}" dataProvider="{DECKER}" xField="date" yField="close" displayName="Decker">
                    <mx:verticalAxis>
                        <mx:LinearAxis id="v2" minimum="150" maximum="170"/>          
                    </mx:verticalAxis>
                    <mx:lineStroke>
           <mx:Stroke color="#CC3300" weight="1"/>
        </mx:lineStroke>
               </mx:LineSeries>
            </mx:series>
         </mx:ColumnChart>
         <mx:Legend dataProvider="{multipleChart}"  horizontalAlign="center" direction="horizontal"/>
    </mx:VBox>
    </mx:Application>

    I've run into this, too:
    Remove the fills property from each ColumnSeries and it'll work.
    If you want to use the fills property, you'll have to add your own custom legend code.
    From the Flex API:
    "If you specify the fills property and you want to have a Legend  control, you must manually create a Legend control and add LegendItems to it."

  • 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

  • How to create a chart with 2 Y-axis?

    Post Author: Chantal
    CA Forum: Xcelsius and Live Office
    I need to create a chart for help desk activities with 1. a serie for the nb of call related to a problem  received per month with the Y-axis on the left 2. a serie for the average resolution time with the Y-axis on the right Any suggestion to create such a chart ,  will be greatly appreciated Many thanks

    Post Author: amr_foci
    CA Forum: Xcelsius and Live Office
    its all based on ur design of your Excel sheet
    design how it will be in Excel first
    then go to xeclsius
    ,,, by the way it looks very easy task
    you can do it.

  • Creating Pie Chart in HAB

    I am developing an application using Application Builder and successfully created a Bar Chart using "cube view chart bean" and NetCharts. However, I have some problem when creating a Pie Chart. I don't know how to set the SliceData parameter. Is it supposed to be the same as DataSets parameter in Bar Chart such as "(${LOOPROWS}, (${ROWNAME_C_C}))".Thx

    Hi Vivek ,
    Thanks for your response . However I am not able to identify which parameter you want to set as PI .
    can you kindly attach an example.
    Regards
    Anirban

  • Create organizational charts using application express

    I would like to create organizational charts using the application express(HTMLDB). How do I go about it?
    I also tried the Aria sample application for HTMLDB 2.0, but when I try to run the scripts it asks for some bind variable parameters ' :NEW ' and ' :OLD ' which I could not identify. Can anybody help with understanding the standard inputs to this?

    A perfectly reasonable question, phrased in
    a perfectly reasonable way (in my opinion).
    On this, I believe, we'll have to agree to disagree. I point you to the following document,
    particularly the section "Questions Not To Ask":
    I'm not sure why you feel the need to point me at a
    document entitled "Questions Not To Ask",
    particularly when I wasn't the one asking the
    question....I pointed you to the section "Questions Not To Ask" in the document entitled "How To Ask Questions The Smart Way" not because I believe you need help asking questions, but because the advice given in that document directly contradicts your opinions:
    "Q: How can I use X to do Y?
    A: If what you want is to do Y, you should ask that question without pre-supposing the use of a method that may not be appropriate. Questions of this form often indicate a person who is not merely ignorant about X, but confused about what problem Y they are solving and too fixated on the details of their particular situation. It is generally best to ignore such people until they define their problem better."
    I admit, I failed to follow the advice of ignoring the person when I first replied, but the issue is whether it was an appropriate question, which I think this quote clearly indicates it is not.
    Robert

  • Trendline Problems with Numeric Axis Charts

    I am attempting to create a chart in Crystal Report XI that lists the time period (months) on the x-axis and the number of units sold on the y-axis. I have created the chart as a numeric axis bar chart because there are some months that do not have any units sold and converted the dates through a formula to periods where the first month requested equals 0 and each of the following months is incremented by 1.  The problem I am having is that the data is displayed correctly but when I request a trendline be displayed, I am getting a trendline that does not correspond with the data. For example I have a 60 month time period where half the months are zero and the maximum number of units sold is 8 and the trend line runs from 30 at period 0 and 24 at period 60. The equation is displayed as y=-1.1x29.9 and the actual trendline should be y=0.0078x0.5802. The trendline in a side by side bar chart is closer but is skewed by the fact that periods with no units sold is not displayed but is closer than what I am getting with the numeric axis bar chart. I have also noted that if I change the scale of the x-axis from automatic or change the gap width, I get wildly different trendlines for each change that still does not match the data. I have also tried to use the date axis bar chart but again the data is presented correctly but the trendline is not correct. So my question is: Can I use a side by side bar chart, in which the trendline seems more accurate, that can account for months with no data and/or is there something that I am missing on setting up a trendline for a numeric axis chart?

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • 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

  • Want to create Monthly chart with weekly data.

    Hi all.  I'd like to create a chart that graphs data over the course of a month similar to this:
    but where the data for the chart is only gathered once a week.  I know from reading in the forums (and trying myself) that if you have missing data fields in your table, you end up with individual points that aren't connected to each other.  So I assume that the solution has something to do with how the chart is labeled?
    Can someone clue me in on how to build a chart that shows each day (as above), but connects weekly data fields (as below):
    Thanks.
    Andy

    Hi Barry.
    It looks like what you're describing is what I've already managed to figure out.  The problem I'm having is that I want the bottom row of numbers (currently 3, 10, 17, 24) to be the days of an entire month (ie: March 1-31).  Then have the values in the chart correspond to the proper day (3, 10, 17, 24).
    Here's what happens if I create a table with all the days of the month, but only weekly fields filled in:
    I realize that Numbers doesn't automatically connect the dots when there are empty fields in a table.  But I can't seem to get to a point where I can have the graph show the entire month, but with a line connecting each of the weekly values.
    I thought that I could do it by creating a custom label for the X axis.  Here's what I tried:
    But of course that didn't work, because the chart still only shows 4 labels (due to the table only having 4 categories).  It just renamed the first four labels.

  • 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

  • I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    I am having problems with creating my apple id. On the phone it is advising me that the ID is not created and then when i do it online it says that it has been created. Can you advise me on what to do please?

    Apple ID FAQ   http://support.apple.com/kb/HE37

Maybe you are looking for

  • Field should not display in the subtotal row in ALV report after sorting .

    we have a requirement, after sorting and subtotaling, the output in ALV is - vbeln        amount1  amount2  amount3 123           11              12            13 123           12             13             14 123           23             25         

  • Log file audit script to search and collect

    Hi guys, I'm trying to figure out the best way to complete this log file audit, so I would like to scripted, but can't seem to get a grasp on it and how best to do it. I need to search for the log files (all log files OS and App logs) on a few dozen

  • XSL Transform, double-byte characters and padding

    I have a stylesheet with the following variable that is being formatted to pad a parameter named textQualifierDescription to a length of 30 by calling the template called format-string. <xsl:variable name="textQualifierDescription2">      <xsl:call-t

  • Cannot assign active correlation

    Hi, I would like to assign an existing correlation to "Active correlation" property box, but I can't. The problem is I can see and select correlation in the combo box but when I click on anyother place on the screen, it goes away. What can cause the

  • I can't merge my mobileME account with iCloud.

    I am having problems, and seem to keep going in circles when trying to merge my mobile Me account to iCloud.  I have an iphone that I want to be able to synch my photostream with.  It just won't seem to allow me to see those pics.  I can't figure it