MDX Calculations Won't Work In My Report (infinity)
Apr 24, 2008
Hello,
I've made a MDX calculation in SSAS and it works fine, but when i look at my report (which is based on my cube), the same calculation gives "infinity".
Now for the complicated part, a person can take absence(sick,holiday,other) for any part of a day or whole day(s). For these absence periods only the worked time on that day needs to be negated off, not the whole period of time.
So for example
If this person
had a days holiday on the 22nd, shown in the HOLIDAY table as
The 'Leave of Absence' on the 20th had no effect on the total for the day as it was between planned work times. how to do this within T-SQL, as simple as possible as I've got to had this code over to other staff members to maintain, who have not had much SQL experience yet?
I've tried doing it as a temp table, with dual insert/select commands, splitting the times over midnight, which partially worked but missed some of the combinations.
I'm trying to build an expression in the textbox of one report matrix (matrix3.textbox12) that divides the value of a text box in another matrix (matrix1.textbox4) by the value of a textbox in a third matrix (matrix2.textbox8). How can I reference one textbox in a textbox of another matrix? Any help would be appreciated.
Public Function TestDivide(Numerator as double, Divisor as double) dim retVal if Divisor = 0 then retVal = 1 end if if Numerator = 0 then retVal = Numerator/Divisor elseif Numerator< = 0 then retVal= 0 else retval =Numerator/Divisor end if return retVal End Function
When Both Numerator and Divisor are 0, I get NaN When the Divisor is 0, I get infinity.
I am trying this approach because I read about it in so many posts on this and other forums, but still having problems. What am I doing wrong? Thanks!
help... I have a field called PercentVar_P4 which really is budget - actuals... I need to create an expression that will that the
PercentVar_P4/budget.. when I do I get Infinity and nan... I want to see the negative number.. I have read through all the blogs and nothing seems to fit..
It appears to work fine on my end however on my clients end, whenever they try to print a report that displays perfectly within the report viewer to their printer by selecting the printer button in the report it never ends up printing.., however if they go into printer setup and change the page range to print from all pages to just maybe one page and then select the print button it seems to print fine..
The printer seems to receive the information as the light flashes but no page kick out when all pages is selected to print..
Working in a project using Entity Framework (Code First)...
Until now the project has been connected to a (generated) SQL Server Compact 4.0 database,
but now we want to connect to a SQL Server (at least 2008R2 since we will use FILESTREAM...)
Our problem right now is the possibility to enter Infinity values into REAL columns in the DB...
It works in the SQL Server Compact but we have not been able to get it to work in 2008R2 or 2014
The insertion of Infinity values is constructed by the Entity Framework (from using float.PositiveInfinity in C#) automatically so I mainly wonder if it at all is possible in a "real" database. Maybe there are some configurations possible to get it to work?
Is there a way to get SQL Server 2005 to store NaN and Positive and Negative infinity values for double precision floats? It used to work fine under SQL 2000 and works great under MS Access, but we are updating our scientific application, and really need to be able to store this information efficiently under SQL Server 2005. We really want to dump Access because of database storage limitations.
It really amazes me that there is not more support for this as the limitation really makes it hard to store a lot of our simulation data. I guess SQL Server is more geared for financial data then scientific data. I know that Oracle supports this but we rather stick with SQL Server if we can.
We really want to avoid having to have an extra column to store this, that would be disastrous. NaN could be stored as null values. And, no, we cannot map +/- Infinity to Min and Max double values. We definitely need the distinction there.
Another post I read talked about custom user types€¦ but I€™m not sure how well that will work with our analysts pulling the data into other tools, like Excel.
Any help or suggestions would be appreciated. It just boggles the mind that SQL Server does not seem to handle true IEEE 754 doubles. How is Microsoft going to deal with C# 3.0 and DLinq support? The issue must show up there.
I have a report model based on Oracle database. My model contains 3 tables and one of them has about 20 millions records. When I create a report using Report Builder, it just a very simple report - 2 columns: name and total sales, the performance is really slow. I am wondering how the report builder + report model works. I did apply a filter and expects to see around 40 rows ( I knew it because I ran a SQL query).
Is there anyone could help me? Perhaps SSRS Team? I am trying to promote Report Builder as an ad-hoc tool in my company.
I just installed a fresh lab machine with WSS 3.0 and SQL 2005. I registered the RS web parts.
In the home page I added the Reports Explorer and the Report viewer web parts. I set up the Reports Explorer and the list of reports are showed.
When I connect the Report Viewer Web part to get report from the Report Explorer web part I get the maintenance WSS page. I have to delete the Report Viewer web part to have the page working again.
If I use only the Reports Viewer with a report (not connected to Reports Explorer) is working just fine.
Any ideas what could be the problem? Any hints on how to investigate this is also much appreciated.
Primary platform is XP as client side and 2003 as server.
When I press F5 in order to see my report from IE appears this error:
An error has occurred during report processing. (rsProcessingAborted) Cannot create a connection to data source 'SQL1.BDADMIN'. (rsErrorOpeningConnection) For more information about this error navigate to the report server on the local server machine, or enable remote errors
However, preview button works properly and data are showed. Let me know where am I failing.
Hi, I'm using one report tool by 'AriaCom' and have got such problems with FREE SQL in that tool. Pls advise!
Message: SQLExecDirect>[ODBC 195][37000][Microsoft][ODBC SQL Server Driver][SQL Server]'instr' is not a recognized built-in function name. Message: SQLExecDirect>[ODBC 195][37000][Microsoft][ODBC SQL Server Driver][SQL Server]'mid' is not a recognized built-in function name.
Hi all, I moved a report to a different solution using the "Add Existing Item" function. Verified that all the data sources were properly connected and that my queries to provide parameter lists were running ok. When I try to run the main data source (a stored proc) from the data tab, I get this message:
"..An error occurred while executing the query. Procedure or function 'ReportSP' expects parameter '@Item, which was not supplied. (Microsoft SQL Server, Error: 201)"
This SP runs fine from the old solution and in Management Studio, so there must be something I need to do in the new report. Can anyone point me in the right direction? I checked the report parameters and it's there. When I try to preview the report, it lets me pick all the parameters, including the one it's griping about, then it throws the message.
works fine in designer but when i load the report services I get the following error anybody know what to do there is one subreport with this report maybe the passing value but what could be wrong ????
Item has already been added. Key in dictionary: '9' Key being added: '9'
Works fine in Visual Studio. Once deployed to SharePoint though, the drill through returns an error that says report can't be found. So I added the .rdl to the conditional statement in the report Design.
I have a drilldown report includes three groups. I add the last group for pagination. But the details in each page doesn't accord to I specified and the detail record number is different in different page.
Another issue is the interactive sort always sort in the first page scope. I set the data region or grouping to the table, and evaluate expression scrope to Detail scope.
i need to get the result of two different queries into 2 different sheets of the same excel file while exporting a report to excel using reporting services..
It's well known issue, that one can't use any dataset fields in a report header/footer directly. One of the approach is to create query-based parameter that basically equals =First(Fields!@FieldName@.Value, "@DataSetName@") and use that parameter value instead. But it doesn't work in my case!
My report displays some entity description and is parametrized with EntityID param. Its header contains entity name that, according to the approach, is queried from the data source through the EntityName report parameter. There's important issue: the report is displayed in ReportViewer control, that is embedded into my application and entity ID parameter isn't ser by user in ReportViewer parameters area. Its default value is changed by the application with SetReportParameters() web method every time a user wants to view the report according to the entity the user is exploring in the application. But after the report has been rendered, its header always contains not actual (outdated) entity name. Nevertheless, the report body contains actual data (including entity name). If I alter entity ID parameter in ReportViewer or in web-based Report Manager and refresh report, header displays correct entity name.
I have a parameter that chooses its available items from a query (with a label and a value column). I set the default for the parameter to the a particular value.
It works in Preview from design mode, but when I deploy it and run the report, it does not set the default.
In my SQL Server Management Studio Express (SSMSE), pubs Database has a Stored Procedure "byroyalty":
ALTER PROCEDURE byroyalty @percentage int
AS
select au_id from titleauthor
where titleauthor.royaltyper = @percentage
And Table "titleauthor" is: au_id title_id au_ord royaltyper
172-32-1176 PS3333 1 100
213-46-8915 BU1032 2 40
213-46-8915 BU2075 1 100
238-95-7766 PC1035 1 100
267-41-2394 BU1111 2 40
267-41-2394 TC7777 2 30
274-80-9391 BU7832 1 100
409-56-7008 BU1032 1 60
427-17-2319 PC8888 1 50
472-27-2349 TC7777 3 30
486-29-1786 PC9999 1 100
486-29-1786 PS7777 1 100
648-92-1872 TC4203 1 100
672-71-3249 TC7777 1 40
712-45-1867 MC2222 1 100
722-51-5454 MC3021 1 75
724-80-9391 BU1111 1 60
724-80-9391 PS1372 2 25
756-30-7391 PS1372 1 75
807-91-6654 TC3218 1 100
846-92-7186 PC8888 2 50
899-46-2035 MC3021 2 25
899-46-2035 PS2091 2 50
998-72-3567 PS2091 1 50
998-72-3567 PS2106 1 100
NULL NULL NULL NULL //////////////////////////////////////////////////////////////////////////////////////////// I try to do an ADO.NET 2.0-VB 2005 programming in my VB 2005 Express to get @percentage printed out in the VB Form1. I read some articles in the websites and MSDN about this task and I am very confused about "How to Work with Output Parameters & Report their Values in VB Forms": (1) Do I need the Form.vb [Design] and specify its properties of the object and classes I want to printout? (2) After the SqlConnectionString and the connection.Open(), how can I bring the value of @percentage to the Form.vb? (3) The following is my imcomplete, crude draft code:
Dim connectionString As String = "Data Source=.SQLEXPRESS;Initial Catalog=pubs;Integrated Security=SSPI;"
Dim connection As SqlConnection = New
SqlConnection(connectionString)
Try
connection.Open()
Dim command As SqlCommand = New SqlCommand("byroyalty", connection)
command.CommandType = CommandType.StoredProcedure ................................................................... .................................................................. etc. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// From the above-mentioned (1), (2) and (3), you can see how much I am lost/confused in attempting to do this task. Please help and give me some guidances and good key instructions for getting the output parameter printed out in the FORM.vb in my VB 2005 Express project.
Hello all. I am trying to do a calculation within an SQL script, however it doesnt seem to be working and i'm a little bit lost. If anyone could shed some light on where i'm going wring it would be much appreciated. The code I have is:
select EMPLOYEE.EMPLOY_REF AS EDIT_REF, SV_EMPLOYEE_CURRENT_HOLIDAY.ENTITLEMENT, SV_EMPLOYEE_CURRENT_HOLIDAY.CARRIED_FWD, SV_EMPLOYEE_CURRENT_HOLIDAY.TAKEN, SV_EMPLOYEE_CURRENT_HOLIDAY.REMAINING, SV_EMPLOYEE_CURRENT_HOLIDAY.SOLD, SV_EMPLOYEE_CURRENT_HOLIDAY.PURCHASED, SV_EMPLOYEE_CURRENT_HOLIDAY.ENTITLEMENT + SV_EMPLOYEE_CURRENT_HOLIDAY.SOLD - SV_EMPLOYEE_CURRENT_HOLIDAY.PURCHASED AS TOTAL_ENTITLEMENT from EMPLOYEE left outer join SV_EMPLOYEE_CURRENT_HOLIDAY on EMPLOYEE.EMPLOY_REF = SV_EMPLOYEE_CURRENT_HOLIDAY.EMPLOY_REF where EMPLOYEE.EMPLOY_REF = = 027
Incidentaly SV_EMPLOYEE_CURRENT_HOLIDAY is a view which currently exists.
In order to find out if an event is late or not I need to do some time calculations in SQL as a Stored procedure. I have a DateTime variable called Due I also have an Allowance variable which is an integer and is an extra allowance for that day and a third variable Now which is set with GETDATE() If I compare Now to Due I can decide if the task is late or not - but I need to take itno account the Allowance. I tried : IF @Due + (@Allowance /24) < @Now ...... However I find that @Allowance/24 always equates to zero so this doesn't work. I'd appreciate any advice. Regards Clive
Hello, I ran into a little problem. My problem is: i need to substract 2 variabeles from 2 different tables in the database
TitleTimes left todayTimes left
My first excercise!15
My second excercise!19
The fields times left are a calculation... the number of times that the admin entered minus a count in the table scores. Has anyone an idea how i can solve this? An example excercise would be great! Thanks in advance
I am attempting to construct a SELECT statement which incorporates some variables. The variables begin life as strings (not String objects) looking like :"6/08/2008" and "06/10/2008" for example. The first is a start date which was retrieved using an AJAX calendar object and the second is an end date retrieved in the same manner. My records are all timestamped by MS SQL (2003) including the clock time. I am stumbling on the syntax. "CallStartTime" is the record's timestamp. The "TraversalString" is something else but I am not attacking that yet. Can anyone make a suggestion or two? SELECT count(*)FROM RealTime WHERE CallStartTime >= '@starttime' AND CallStartTime <= '@endtime' AND TraversalString LIKE '%1.0%'
Timespan = 30 days Start Date = January 1st Last Processed Day = NULL Next Cycle Day = IF(Last Processed Day IS NULL) Start Date + TimeSpan ELSE Last Processed Day + TimeSpan Is it possible to setup a column to do this from sql?
I have a timesheet table and I am having trouble getting a calculation to work correctly. I'd like to subtract the punch-in times from the punch out times for a specific period, such as 1 week, and then add the time together and get the number of minutes worked altogether during that time.
The table is simply
Employee ID (int) PunchIn (datetime) PunchOut (datetime)
I am trying to do a calculation to find rows which have a date which is 2 days older the the getdate(). i.e Select documentdate from table where documentdate < (getdate() - 2)
I think that I want to want to build a temporary table in a stored procedure that handles multiple calculations.
I'll try and explain and hopefully you can tell me what i want
First i want to populate a list of all dealerstaff.
Code:
Select * From tblDealerstaff
I Then want to calculate the percentage tasks completed. So i find the number of available awards.
Code:
SELECT TOP (100) PERCENT COUNT(NoPerStaff) AS NoAwardsAvailable FROM dbo.tblIndivAwards
Then i can find the number awards recieved per person.
Code:
SELECT TOP (100) PERCENT COUNT(dbo.tblIndivAwarded.AwardID) AS AwardCount FROM dbo.tblIndivAwarded INNER JOIN dbo.tblIndivAwards ON dbo.tblIndivAwarded.IndivAwardID = dbo.tblIndivAwards.IndivAwardID WHERE (dbo.tblIndivAwarded.staffID = @StaffID)
I want to know if it's possible to piece all of this calculation into a single stored procedure. I need to do this sort of thing all the time, as i display overviews of the projects i run to the senior managers.
I always do the maths in the ASP, and consequently i can't sort on the calulated totals.
Is this possible, or am i asking too much ?
Thanks in advance, as any help will be greatly recieved.
I sometimes find myself in the situation where I want to insert a row into a table using the following form: insert table ( <field list> ) select <field list> from .. etc .. Where <conditions>
My question is to do with where one or more of the fields in the select field list are calculations and where I also want to use some/all of these derived fields as Where conditions. [ Eg: only insert if the calculated value is > 0]
I currently either repeat the calculation in the Where clause or move it to a function and use the function call in both places. (I always get a pang of guilt using either option - repeating the calculation feels like bad practice - & using the function twice seems inefficient (does this get optimised?)).
I could get a life & stop worrying - but is there a better/neater way of doing this?