SSRS Use a formula for a line graph y = mX + b

Hi I want to show a line on a line chart using a formula in the form y = mX + b.   Can't seem to get this to work.   I inputted the formula into the "Value field" of the "Data field" but the line doesn't show up.
X = value for X axis (it's a date);  m and b are query fields (both type real)    The data is grouped on two fields that are specified in the "series field"
There are multiple values for X but only one value for M and B.
So for all dates (X) for each Group 1 AND Group 2 combo: chart this line.
Using: SSRS Visual Studio 2008

Hi 317704,
Linear Regression line might be what you need, you have to get the records in the database using the T-SQL for all the points on the X-Axis following the below formula. Where n is the total number of data points, and the tis and yis are the components of
the data point tuples (ti, yi).
 I give a sample below,
My datasource(AdventureWorksDW2008):
DECLARE @start_month
SMALLDATETIME
DECLARE @end_month
SMALLDATETIME
SET @start_month
= '2002-01-01'
SET @end_month
= '2002-12-01';
SELECT
CAST(CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
+ '01'
AS
SMALLDATETIME)
AS CalendarMonth
,SUM(SalesAmount)
AS y
FROM FactInternetSales
INNER
JOIN DimSalesTerritory
ON FactInternetSales.SalesTerritoryKey
= DimSalesTerritory.SalesTerritoryKey
INNER
JOIN DimTime
ON FactInternetSales.OrderDateKey
= DimTime.TimeKey
WHERE DimSalesTerritory.SalesTerritoryKey
= 9 --Australia
AND
DATEPART(YEAR,DimTime.FullDateAlternateKey)
BETWEEN
DATEPART(YEAR,@start_month)
AND DATEPART(YEAR,@end_month)
AND
DATEPART(MONTH,DimTime.FullDateAlternateKey)
BETWEEN
DATEPART(MONTH,@start_month)
AND DATEPART(MONTH,@end_month)
GROUP
BY CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
You could get some reference from top sample.
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.

Similar Messages

  • I need to get 2 decimal places when using a formula for a quotient and Numbers will only give me whole integers which is useless since most items will be less than 1. How can I change this?

    How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places

    the quotient function returns only whole number portion of the dividing two numbers.  If you want the actual decimal value use the divide operator.  you enter this as:
    A/B
    if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
    =A1/B1

  • Combine output  from two data sources for a line graph.

    Hello Experts,
    I need your help in following scenario.
    Scenario - We have a line graph created in VC. We have a numeric field in the data seris and a date field in the Category axis.
                      This is working fine.
    Requirement - Customer wants month names instead of dates on the category axis of the line graph.
    Problem - The RFC which is providing the data to line graph doesnot have a output field giving month names instead it has dates.
    Options Tried - Tried using 'Union' and 'Switch' operator with a RFC giving month names. Unfortunately this doesnot work.
                             One close try was with 'union' operator but it ignores the numeric fields.
    Any help would be highly appreciated.
    Thanks & Regards,
    Amit Kade

    Hello Sandeep,
    Thank you for the reply. I did try to do changes in RFC, I am calling a FM which gives me month names in my original RFC.
    But still the outpot of this FM is in a seperate table and anyways I will have to combine these two tables.
    Problem still remains the same.
    I tried using 'Filter' to convert date format but after applying filter my VC application is not deploying.
    Thanks,
    Amit Kade

  • How to set the 4th Y axis color for a line graph

    Hello experts,
    I have developed a multiple y axis line graph using oracle reports 10g.
    It has got 1 x axis and 4 axes. I am able to set the color of the the first three y axes
    but the reports designer automatically assigns yellow color to the 4th axis.
    I mean there is no option in the graph wizard for changing the 4th color)
    How to change the color of this 4th y axis to a desired color?
    Cheers
    Sri

    Assuming you mean that your graph has 4 series, not 4 Y axes, you might try something like this:
    1. Save a backup copy of your current report in case the changes you are about to make don't work out and you want to revert to the backup copy.
    2. Using the Property Inspector, display the current value of the Graph Settings property for your graph. The value of the property should be something like:
    <rw:graph id...
    </rw:graph>3. Look for a <SeriesItems> tag and a matching </SeriesItems> tag in the property value. If you don't find them, add the following two lines immediately before the </Graph> tag.
    <SeriesItems>
    </SeriesItems>4. Between the <SeriesItems> tag and the matching </SeriesItems> tag, add (or update) a <Series> tag for each series that you want to specify the color for. For example, to specify the color of the fourth series as red, you would use a <Series> tag like this:
    <Series id="3" color="#ff0000"/>Note that the id numbers start at 0 for the first series, 1 for the second, and so on. The color value is a hexadecimal number specifying the RGB value of the color.
    You can also use the <Series> tag to specify other features like the marker shape.
    For more information on what you can do using the Graph Settings property, see this FAQ and Technical Note.
    Hope this helps.

  • CEP Pattern Matching for Straight line graph

    Hi,
    I have a scenario where weight is directly proportional to depth, which produces a linear straight line.
    CEP will get data for weight and depth, CQL has to be write to raise an event when there is a change in straight line graph.
    How to write CQL query and use match pattern for this.
    Thanks,
    Sri

    So lets say you have an input Channel with event Type E(weight, depth)
    Idea is to compute the slope - weight/depth and report the first and those subsequent events whose w/d is different from that of the previous event
    Here is the query
    SELECT
              T.weight,
              T.depth
    FROM
              E MATCH_RECOGNIZE (
                    MEASURES
                             A.depth as depth,
                             A.weight as weight
                    PATTERN (A)
                    DEFINE
                             A AS ( (PREV(A.weight) is null) OR (PREV(A.weight)/PREV(A.depth) != A.weight/A.depth) )           
              ) as TEdited by: Anand Srinivasan on Mar 8, 2012 7:56 AM

  • How to use a formula for dynamic New Page After?

    There is a formula for dynamic New Page After.
    How do I get value of formula?
    I am using RAS and the ReportClientDocument.

    There is a section object.  Off that there is a format property that is of type sectionformat.  From there there is a ConditionFormulas property which I believe is a collection of all the formulas you can set for a section.

  • What do I need to use unified messaging for single line voice mail

    I am a solo practitioner, and would like to use UM to answer calls to my business number, locate me on my cell phone if appropriate, or give a non-business hours message, and take a secure message.
    I do not want to use cell phone voice mail due to security concerns. I currently have a number that goes straight to a hippa compliant voice mail service only, but will not follow me on my cell. What is the minimal set up I need to forward calls to UM? Do
    I actually need a physical phone, or would just a sim chip or some other service work?

    Hello,
    Here is the entry for Exchange Online Forum:
    https://social.technet.microsoft.com/Forums/msonline/en-US/home?forum=onlineservicesexchange
    Thanks,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • Is iPhone Secure to Use Credit Card For On-line Purchases ?

    With a browser I know that I have a secure connection when I see "https" and a locked security icon.
    How do I know if my iPhone 4S app is secure ???
    Should I only conduct iPhone 4S credit card purchases on the cell connection and NOT on the WI-FI connection ???

    You need to contact Apple iTunes Store Customer Support.

  • Line Graph - set useful baseline value automatically

    Hi all,
    for a line graph in reports I've set the axisMinAutoScaled-property of the Y1Axis-element to "false" and expect that reports find out a useful value for the baseline at its own. Unfortunately the value of the baseline is always set to 0 whether a range of 1.000 to 10.000 or a range of 1 to 10 is selected.
    Do you know a way to set the value of the baseline depending on the displayed values.
    Thanks in advance.
    Martin
    Edited by: user11939409 on 14.06.2011 08:43

    Hi Sreehari,
    I tried to set the y-axis scale for line chart by using code. But its showing the default value, not displaying the value what i gave. Adding my code for reference. 
       var axis = new sap.viz.ui5.types.Axis().setScale(
           new sap.viz.ui5.types.Axis_scale().setMinValue(20.0).setMaxValue(100.0).setFixedRange(true));
              column = new sap.viz.ui5.Line({  
                width : "100%",
                height : "400px",
                legendGroup: legendPosition,
                plotArea : {
                colorPalette : ['#F67A7A','#FEE00A','#B6C359'],
                title : {
                  visible : false,
                  text : ''
                xAxis:{
                title:{visible:false} ,          
                yAxis : axis ,
                dataset : dataset

  • How to make use of a different data model for a line chart?

    I have a datamodel which is a sql query. I have a line chart on my template which is using some "Start Time" field as X-Axis. There is a chance that "Start Time" is null. In such cases the plotted point doesn't appear with x-coordinate. But I can't change the X_Axis field to some other not-null attribute due to business requirement.
    I am thinking to create another datamodel which filters all "Start Time"s which are nulls and use that datamodel for the line chart that has "Start Time" as X-axis. But I don't know how to do this as whenever I try to insert a line chart from BIPublisher menu in MS_Word, I am not prompted to select the datamodel.
    Can anybody tell me what I am trying is possible? If so how? If not, how do I have "Start Time" as X-axis without hassles?
    Thanks,
    -Vijay-

    Are you able to extract the data based on the new data model in an XML file? If so, in BI publisher desktop, are you able to load the XML data via Add-Ins ->Data -> Load XML Data?
    If you have been able to load the data successfully, then you need to Select Chart from the Insert Menu. When you do that, you should be able to see the Data layout on the left side of the chart dialog box. Then you should be able to drag and drop fields as necessary to create the chart. Are you having issues doing this part?
    You will not be prompted to select the data model. Hope I haven't misunderstood your question.
    Thanks!

  • Multiple Line Graph

    First off, thanks to kglad for the line graph function I
    started with, it has been a huge help. Now the step I'm trying to
    take is 2 fold.
    First, I'd like to graph more than one line segment on the
    graph. Right now I am graphing functions f1 and f2, but f2
    currently overwrites f1. I want them to coincide so f1 goes from
    x=1 to x=15, f2 goes from x=15 to x=25, f3 goes from x=25 to x=10
    at a different y (these are all curves), and finally f4 goes from
    x=10 to x=1 creating a closed shape. Also, I want the x values and
    the y values to be variable based on the temperature. I'm using
    PV=nRT and n, R, and T are all known. so I have something like
    P=nRT/V where P is y, V is X and the nRT can be calculated for two
    steps of the 4. The other two steps are adiabatic, so Q=0, I don't
    know yet how to fit the lines but i do know that y = a / (x^(5/3))
    is a formula that works, I just need to find the proper a values
    for steps 2 and 4.
    Part two of this issue is that currently the graph is drawing
    as the whole canvas, which is fine for testing until i get the
    multiple line part worked out; however I only want this to be 1/4
    of the viewing area as I have other movie clips and such to put on
    this. A conceptual drawing of what I plan on making can be found
    at:
    http://www.students.bucknell.edu/gbement/Steps.html
    I'm a novice to Actionscript and movie clips, I previously
    did everything with motion tweens and nothing was dynamic. I plan
    on creating the piston and molecule simulation in another movie
    clip, then I can vary the play speed relative to the hot and cold
    temperatures by looping the movieclip and having it play faster for
    a high T and slower for a low T.
    Any help on any of my many issues would be greatly
    appreciated and the user will be recognized for their assistance in
    my research presentation :)

    Hi Arun, thanks again for the help but upon closer inspection
    (along with only a basic knowledge of java and actionscript), I
    think your script would need editing to work for me (editing i'm
    unsure of how to do). What I'm looking for is a graph that will
    create a line based on a function. Much like y=(a*b*c)/x or
    y=(a*b*c)/(x^1.66) The a*b*c would be complicated also, but here's
    what i've thought up on paper that I have to move to script, I hope
    this is useful:
    Step 1: Calculate the a*b*c
    The original function is PV=nRT , nRT being the a*b*c ,
    however the Thot and Tcold terms are input boxes that the user
    types in before hitting the "go" button.
    So I have to do this much:
    tcold = Number(tcold_num.text);
    thot = Number(thot_num.text);
    var n:Number = 1;
    var R:Number = 0.0825;
    var a:Number;
    var b:Number;
    var c:Number;
    var d:Number;
    a = n*R*thot // Step 1 constant
    b = // Step 2 constant (formula to be finished :-/) Looks to
    be a formula using ((b) / (Math.pow(x, 1.666)))
    c = n*R*tcold // Step 3 constant
    d = // Step 4 constant (formula to be finished :-/)
    Then I need to find a way to initialize axis to line the
    graph, I can label the P and V axis using static text boxes later I
    suppose.
    The problem I have with yours that I don't understand is that
    I could add the function into the y part of the addLine() function,
    however it's noted as inity= y1 (requires a number), and the
    function definition has y1:Number.
    Now the issue i'm tackling below is just a newbie's lack of
    understanding (i hope), but the script kglad wrote (snipped below)
    will graph one line, and i can't figure out for the life of me how
    to write this up to graph more than one instance without
    overwritting the previous line. Again, Thanks for the help so far,
    it has helped me find the points where I lacked direction and solid
    ideas before.

  • Help needed in plotting Line Graph!!!!!!!!!Pls help!!

    Hi, i need help in plotting a simple line graph showing the x&y axis and has to plot 3 different lines in the same graph.I have written a program and i need to implement this graph in it.Is there any tutorial for plotting line graphs,i mean steps included.
    Please help!

    You describe your need, but not where it originates from.
    Is it a programming assignment? If so, I hope this is not your chosen major, as you will fail because you are a non-resourceful plagarist.
    Do you need to simply graph some data? Use an existing package. There are free ones somewhere.
    What do you mean "i have written a program and i need to implement this graph in it"? If you wrote the program, wouldn't you be done?
    Enjoy programming

  • How do I change the line color in a line graph?

    I used Illustrator to create a line graph. (Not my desired option as I normally import them from R and then edit, but the textbook wanted to show that you can create graphs and edit them in Illustrator)
    Anyway, I did all of the editing except that I can't change the color of the line. My assignment requires me to match the textbook example and the textbook does not provide instructions on how to do it. I've done just about any method I can think of and the line still stays light gray. I'm almost willing to just give up and lose the points but something as simple as color can't be this hard, right? Right?

    Whenever I try to shift+direct select it thinks I want to move the line, so as I shift + direct select and drag my mouse across the line (to highlight it all) it moves a chunk of the line and turns it into a near perpendicular line.
    I found the appearance window, it just says "Path" (the color I want it to be that it's not)
    "Stroke" 4pt
    "Fill" (the color I want it to be that it's not)
    "Opacity": Default
    And some other buttons. I think I'll try the help line tomorrow, I know I saw a customer service number somewhere and I'm only here because the chat was unavailable. This is only one of my 3 problems with my assignment so I'll search here for answers to the other two. Learning new things is rarely fun.

  • Marker shape not showing up in DVT line graph

    Hi,
    I am facing an issue where the Marker Shape is not getting displayed in DVT Line graph. In the graph there is only one series, in which diamond markers should appear at the data points.
    I am using Jdev 11.1.1.7.0.
    Below is the expected result and the result which i am actually getting. Although the data set is different, the diamonds which we see in the first graph are not appearing in the second one(my output).
    My code snippet for the line graph is as below:
    <dvt:lineGraph id="lineGraph1"
                           value="#{bindings.VarianceGraphVO1.graphModel}"
                           subType="LINE_VERT_ABS" shortDesc="Variance Graph">
              <dvt:graphTitle text="Schedule Variance"/>
              <dvt:y1Title id="y1Title1" text="Variance % Days"/>
              <dvt:o1Title id="o1Title1" text="Cemli"/>
              <dvt:background>
                <dvt:specialEffects/>
              </dvt:background>
              <dvt:graphPlotArea/>
              <dvt:seriesSet defaultLineWidth="3">
                <dvt:series markerShape="MS_DIAMOND" markerType="MT_MARKER"
                            lineWidth="2"/>
                <dvt:series/>
              </dvt:seriesSet>
              <dvt:o1Axis rendered="false"/>
              <dvt:y1Axis/>
              <dvt:legendArea automaticPlacement="AP_NEVER"/>
            </dvt:lineGraph>
    Even though the marker shape property is mentioned it is some how not reflecting in my result. Even other types of marker shapes like square, circle, up/down arrow are not working.
    Request you to help me fix this issue.
    Thanks a lot.
    Regards,
    Tejas

    Try to set seriesSet  defaultMarkerShape="MS_CIRCLE" and markerDisplayed="true" like:
    <dvt:seriesSet defaultMarkerShape="MS_CIRCLE" markerDisplayed="true">
           <dvt:series/>
    </dvt:seriesSet>

  • How do I make a line graph that shows temperature readings taken on specific dates?

    I need to make a chart of my wife's temperatures taken via ovulation thermometer. All I need is a line graph that shows the temperatures on the y axis and the dates the measurements were taken on the x axis.
    What is the easiest way to do this? Please explain in detail as I have almost no knowledge regarding Numbers. Thanks.

    You can construct a Line graph or a Scatter graph to display this.
    The two are similar, but require the data to be set up differently.
    A Line graph is a Category graph.
    Each 'date' is a text value that names a category. The categories are equally spaced along the category axis. Measurements taken on day 1, day 2 and day 4 would be equally spaced with respect to the category axis.
    Each temperature reading is a numerical value, and is represented on the graph by the distance it is placed from (and usually above) the category axis.
    A Scatter graph has two value axes.
    Each Date is a Date and Time value. The position of these values depends on the value itself. Measurements taken on February 1, February 2 and February 4 wound not be equally spaced. Along the Date axis, the space between the second and third dates would be twice as wide as that between the first and second cates.
    Each temperature reading is a numerical value, and is represented on the graph in the same manner as in the Line graph.
    Here's an example of each, using the same data set.
    For the Line graph (left), the Category labels (dates) are placed in a Header column, and the temperatures in a non-header column,
    For the Scatter graph, both the dates and the temperatures are in non-header columns. The Chart Inspector was used to Connect the data points with straight line segments, and the weight of these lines (and size of the data point markers) was increased to more closely match the weights and sizes in the Line graph.
    Data on the graphs is not intended to have any similarity to temperatures measured for your purposes.
    The construct the line graph:
    Set up the data and labels as described.
    Select the cells containing the data (column B in my case).
    Click the Chart button and choose the Line Chart.
    To construct the scatter chart:
    Set up the data as described.
    Select the cells containing the date and temperature data (columns A and B for mine)
    Click the Chart button, and select the Scatter Chart button (third from the bottom),
    In the Chart inspector, click the Series button, then set the Connection Points menu to Straight. Change the Data Point size yo 15.
    Click anywhere on the line to select it, then in the Stroke section of the Format bar, set the line weight to 4 points.
    Click on the box containing the dates (under the chart), then click the ruler icon in the Inspector to show the metrics inspector. Use the Rotate control to set the angle for the dates to about 75°.
    Click on the label for this axis (Dates) and drag it to a position below the date labels.
    Regards,
    Barry

Maybe you are looking for