Hi,
I am values in scientific notation when i am rendering the report into excel.
I wanted the number to be displayed as it is without any scientific notation(exponential format)
I am using data flow. source is ole db and target is flat file (csv). I run sql server stored procedure in source and mapped all columns to target file.
Value "-5.0000000000000003E-2" is giving me hard time. It's coming in target file how can remove exponential before writing to target file. In source table that value is coming from float type column. I would like to use some function in select sql if I can.
Exponential Moving avg is calculated using the formula.EMA = (Today's Price)* K + (EMA yesterday) * (1-K)where K = 2 / (N+1)The user is going to Input the K.It is something likeF(N) = Price * K + F(N-1) * (1-K)How can I reference, the previously calculated value in the Next rowcalculation. I need to implement this in SQL Server.I created a Stored procedure to do this and I used a Temp tbale withIdentity.Create Table #TempMovAvg(MID int identity(1,1) Primary key, tempDate DateTime, tValue float)I Populate the data for that temp table using the below query.Insert Into #TempMovAvg (tempDate, tValue)Select Date, Price From DataTableI tried Diff options to calculate the exponential Moving Avg using theabove formula, but none of them are giving the correct answers. I amnot able to reference the Prev Calculated value in the Next rowcalculation.Some queries I used.Select a.TempDate, a.tValue,0.9*A.tValue+0.1*(Select 0.9*t1.tValue+0.1*t2.tValue From #TempMovAvg t1, #TempMovAvgt2 Where t1.MID=A.MID and t2.MID=t1.MID-1)FROM #TempMovAvg AWhere A.MID>=2order by a.TempDateSELECT A.MId,SUM(CASE WHEN B.MID=A.MID THEN 0.9*B.tValueELSE 0.1*A.tValue END) exponential_averageFROM #TempMovAvg A, #TempMovAvg BWHERE A.MID>=2 AND A.MID BETWEEN B.MID AND B.MID+1GROUP BY A.MIDAny help will be greatly appreciated.thanksGanesh
I have my stored procedure set to Territory_code IN (@Territory)
, now , how do i enter in more then one value. When i select the multi value check box, it gives me more spaces. But then doesnt recognize the values when i put in more then one. am i doing something wrong?
Whenever we restart the services on this one SQL server 2005 instance, the database autogrowth changes to grow by 2500%. We have to manually change the autogrowth of data file to some sane number. Has anyone faced this issue? We tried to put SP2 on but even that doesn't help. Any help would be appreciated
How do I display multiple parameter values on report page from a multi-value report parameter. For example, I have a report parameter where users can select multiple attendance codes and I want them displayed at the top of the report after it's run.
Currently, only the first value is showing on the report.
I am designing a report which will be used under the subreport control of a master report, now i am using a stored procedure for the subreport which has two parameters.
In the subreports dataset parameters tab, how can i mention the master reports columns, since i do not see the master reports columns here. since it is a different report.
If i use a hardcoded select query then i can just say
select address, city, state, zipcode from customer where (customerid = @customerID)
but i am using a stored proc. how to define the parameters under datasets parameter tab.
The issue is in the data flow for loading and setting the Fact table dimension keys (the dimensions are all loaded fine). After 16 rather pedestrian Lookup Transformations, I have an escalating problem adding additional Lookup transforms to the Data Flow. The problem is not in execution; the problem is adding more transforms in design mode.
Lookup # Fields in Data Flow Time to validate that lookup <17 47 Sub-second 17 48 2 sec 18 49 4 sec 19 50 8 sec 20 51 16 sec 21 52 32 sec 22 53 64 sec
While I€™m intrigued by the mathematical progression that is forming here, the issue is that I have at least 6 more Lookups to perform. I hope you can see my dilemma.
I have gone to where it takes a little over 4 minutes each to validate the lookup transform and its associated Derived Column transform and Union transform (Total 12 Minutes). Not only does this add up to many idle minutes to each design step, BUT it breaks the debugger as it pre-validates the ENTIRE data flow before it ever switches into debugging mode.
Some notes: 1. It doesn€™t matter what order the Lookup transforms occur in, the timings are exactly the same. 2. I tried many Data Flow execution optimizations, but they don€™t improve the validation times (or even get a chance to improve the execution times!)
I realize this may be somewhat of a unique problem.
Am converting varchar field to float and summing using group by and next inserting to varchar field(table).
while inserting float value it is converting to exponential ex:1.04177e+006 but if i execute only select statment actual float value will get display ex:1041765.726
My question is why it is converting while inserting ? and how to avoid it.
I am importing a text file with a column (serial numbers) with alphanumeric data, some mixed and some only numeric. The very large values that are all numeric are being converted to exponential when I run it thru an import package in SQL Server Integration Services (2005)
Ex. 4110041233214321 --> 4110040000000000 (displays as 4.11E+15)
In the past I dealt with this by importing the text file into Excel and changing the format of the column to number. This works even when many of the values contain alpha characters. I am not sure how to accomplish this same thing without going thru Excel. If you have any ideas on this I would be happy to hear from you.
I am somewhat new to SRS. I am creatnig a report containing a Matrix. I did this because there are one or more columns included in the data set. I would like to add totals to both the rows and columns.
Here is data samples of the matrix: Columns: C1, C2, C3... Rows: R1, R2, R3, ... There is a total making up the data section and looks like this (I will just use Valx for the value in the data section):
C1 C2 C3 .... R1 Val1 Val2 Val3
R2 Val4 Val5 Val6 R3 Val7... .... . . .
I would like to total each column and have a summary at the bottom (for the C1 this would contain Val1+Val4+Val7) and also like to have an extra column containing totals for each row (for the R1 this would contain Val1+Val2+Val3...).
Is there a way to do this? Am I missing something obvious?
Thank you for any help, it is very apprecaited. Eric
I use OPENROWSET to read values from Excel and store them in a SQL Server table. In the Excel file I have a row having format 'Number' with two decimal places.
Example: 1225000.00
When I select this value using SSMS I get the correct value:
1225000
Strange enough, I cannot see the decimals anymore. However, when I now store this value into my table and then select it from there I get: (the datatype in the table is VARCHAR(max))
1.225e+006
I would not care if I could convert this back to a numeric datatype but this seems not to work: CAST('1.225e+006' as INT) throws an exception. Obviously OPENROWSET sends the data strictly as a character string. Storing this into varchar(max) works for small figures but it starts to use exp values for big figures.
Does anybody has an idea how to bring huge Excel based figures safely into a MS SQL Table ?
I've designed a report and assigned it a datasource that binds with a SP with a parameter. In the XML code of the dataset I can see the input parameter has been recognised by the wizard. Then, I built a report with that Dataset as the source. Everything is fine till this time. Now through my aspx code I pass on the value of the parameter to the report. But the report doesn't show any values at all. The aspx code is like
Code Snippet Dim reportParameter As New ReportParameter("@UserID", Convert.ToInt32(TextBox1.Text), True) Dim test() As ReportParameter = {reportParameter} ReportViewer1.LocalReport.SetParameters(test)
Any ideas what I could be doing wrong? VS 2005 & SSRS 2005. TIA.
I am trying to create a report in SRS that will calculate a Composite Score based on the Sum of other scores and then that Sum is divided by 12.
Here is a copy of the Query I have created to calculate the numbers I want to use, but when I create the expression in SRS the calculations don't come out correctly. The expression that I use in SRS is at the bottom of the Script.
Thanks in Advance
--6 Trait_03052008.sql
--Pull test scores for 6 Trait out of Campus for SRS reports.
SELECT s.lastname+','+' '+s.firstname AS Student, e.grade, sm.lastname+','+' '+sm.firstname AS Teacher, sc.name AS School,
t.name AS Test, t.code, ts.rawscore,
CASE WHEN t.name = '1 Ideas' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore * 3 AS Numeric)END AS IComp,
CASE WHEN t.name = '2 Organization' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore * 3 AS Numeric) END AS OComp,
CASE WHEN t.name = '3 Voice' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore * 2 AS Numeric)END AS VComp,
CASE WHEN t.name = '4 Word Choice' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore * 2 AS Numeric)END AS WComp,
CASE WHEN t.name = '5 Sentence Fluency' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore AS Numeric) END AS SComp,
CASE WHEN t.name = '6 Conventions' AND ts.rawscore IS NOT NULL THEN CAST(ts.rawscore AS Numeric)END AS CComp
FROM testscore ts
JOIN student s ON s.personid = ts.personid
JOIN roster r ON r.personid = s.personid
JOIN test t ON t.testid = ts.testid
JOIN calendar ca ON ca.calendarid = s.calendarid
JOIN enrollment e ON e.enrollmentid = s.enrollmentid and e.calendarid = ca.calendarid
JOIN section se ON se.sectionid = r.sectionid
JOIN course c ON c.courseid = se.courseid AND c.calendarid = ca.calendarid
JOIN school sc ON sc.schoolid = s.schoolid
JOIN staffmember sm ON sm.personid = se.teacherpersonid AND sm.schoolid = ca.schoolid
WHERE t.code LIKE '6%' AND c.calendarid =50 AND c.homeroom = 1
GROUP BY s.lastName,s.firstName,e.grade,sm.lastName,sm.firstName,sc.name,t.name,t.code,ts.rawScore
ORDER BY [Student], t.code, t.name DESC
Expression being used in SRS to calculate the Composite Score.
Hi to everyone.I have this problem in my chart control in report.I am retrieving datas from my database.My x-axis is consist of dates of the year,y-axis is the hit counts.My problem here is when i only have hits in only one month(ex december) and almost over 20 hits are retrieved,the bars of my graph become so overcrowded and overlayed which make the value unclear to see.And also another thing is my legend repeats the color when there are too much data.is there anyway to fix this or this is just a ReportingService bug??Hope not..hehe.. Thanx
I use a parameter for product type in my report so that end user can select different product types from a drop down menu. Now my problem is that for some fields product type is blank(NULL). But end user can not see these NULL value when he click drop down menu. I can not use Allow Null value option in report paramter , because I have used multi value option. Is there any other way to select these NULL values?
I need to somehow set up a third parameter which allows me to control the tag quantity type either by ALL - % , IS NULL, or IS NOT NULL.
I tried TAG_QUANTITY LIKE :Tags but this would only work if I had the % option select and not the IS NULL or IS NOT NULL
Any thoughts on how to format the select statement?
SELECT ORGANIZATION_ID, TAG_ID, PHYSICAL_INVENTORY_ID, TAG_NUMBER, CREATION_DATE, VOID_FLAG, TAG_QUANTITY, TAG_UOM, SUBINVENTORY, LOCATOR_ID, COUNTED_BY_EMPLOYEE_ID FROM INV.MTL_PHYSICAL_INVENTORY_TAGS WHERE (ORGANIZATION_ID = ite) AND (PHYSICAL_INVENTORY_ID = :InventoryID) AND (VOID_FLAG = 2) AND TAG_QUANTITY IS NULL ORDER BY TAG_NUMBER
I will try to explain this best I can. I have a report where it shows total number of pieces over time. This range is from 0 to like 100 pieces. I have done a UNION query to add average accumulation (in inches).
If adding average accumulation to the "Data fields" section of the report in report designer, It shows the average accumulation on the bottom in releation to the number of pieces. (which is what I want.. But.. ) The numbers are not proportional obviously there wont be 60 inches of snow.. more like 1 or two inches.. So the line is very close to the bottom almost invisible..
Now that ive dont a muck up job of explaining.. This is what im looking for.. Some type of chart that will overlay the average accumulation but somehow be smart enough to show the different scale of precipitation vs pieces of equipment.
I have a report that has 2 parameters. I use this report to do comparisons of performance data between two builds of our product. I'm not hosting this report in a seperate page, just using the standard sql reporting services web interface.
I'd like to be able to send out a link to this page that will load up the page with values for the parameters specified. I know in the report definition itself I can change the default parameter values, but I'd rather not change and redeploy the report every time I need to send it out for others to view.
My first thought was that it should be easy enough to specify the parameters as part of the url querystring and read the values in somehow using an expression for the parameters default value. Is this possible? I've done a bunch of searching but can't seem to find any good examples of this.
When I use calculation in generating reports, I get "NaN" value in preview , I wanted to avoid this and display "0" if the result of calculation is null or infinity..
I used the below calculation
=CDbl(Fields!POST_TEST_COUNT.Value/Fields!ENROLL_Actual.Value), here i taken input as percentage for every field.
Please let me know how to avoid "NaN" and "infinity", while displaying in reports
when ever i see the prview NAN values are displayed and remaining fields are shows appropriate query results like percentage values Like 98%.00 some thing but i have a problem with NAN values i need to change those NAN values to 0
Does anybody knows how to reference a value inside a group in a Matrix. I know it should be possible to use a calculated field, but I can't find a way to calculate a simple percentage!
example: (The Orders Group have "Received" and "Accepted" columns and these are created Dynamically, and I want to add a calculated field (ie. "%Accepted") to the group.
Simple Formula %Accepted = "Accepted" / "Received" i.e. %Accepted = 5/10 :. (50%)
I am building reports against our TFS development db. One of the reports tracks days spent (Dwell Time) in various status categories (eg: New, Assigned, In Development, Hold, etc) for a given "ticket". For a fixed list of values from {Work Item].System_State, I can send the results (days in Assigned) to the column named (Assigned) for each status for each event in the [Work Item History], and then sum them for each ticket as: Ticket ID New Assigned InDev etc 1230001 2 0 0 ... 1230001 0 1 2 ....
SUM 2 1 2 .... However, I have many different Projects, each of which use their own Status names. I don't want to duplicate the same basic report, if I can avoid it.
How can I name and generate this data for the unique Status list for each Project?
Simplest analog is: name = First(Fields!Status.Value, "TFSdb") and allows value for a column name (category) as: =IIF(Fields!Status.Value = First(Fields!Status.Value, "TFSdb"), Fields!Days.Value, 0) However this fails beause: 1. It only delivers the FIRST status value, and, 2. I cannot SUM an expression which is itself an aggregate (using First).
I was wondering if anyone knew how to take a value from a subreport and compare it to a value iwthin the main report. We are trying to see if the value in the subreport is greater than the value returned in the main report. We want to make the value test red if it is greater than. I know how to compare these values if they were in the same report, but when it comes to subreports I am lost. Any ideas? Thanks in advance.
Hallo is it possible to perform an insert/update query upon the execution of a report, using the report Visual Basic expressions? I mean, the user enters some values for the report parameters, and i would like to store them, along with the resulting recordset data, into a dedicated table in the database.
1. I have one combobox for supplierID, it displays 1,2,3... Now i want to display the corresponing SupplierDescription in the textbox placed in the Page Header Section. If it is multiple selection then it has to be seperated by ',' (Comma).
Ex: IF i select 1,2,3 in the combobox then in the TextBox should look like Suplliers: Ram, Don, Krish
when i use a filter in report builder, it's not able to retrieve the information to populate the dropdown menu, the dropdown menu is empty. I get a triangle with exclamation mark and the following message and the drop down box is not being populated:
the requested list could not be retrieved because the query is not valid or connection could not be made to datasource
I am able to generate reports but not able to use filter. what could cause this issue ?