.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Sgraph Infotech
Imran Ghani
Post New Web Links

MDX - The function expects a tuple set expression for the 1 argument

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
 
I have a  scenerio dimension with several different scenerios. I am trying  subtract the measure values of the descendants in one scenerio to it's cousin in another scenerio. Here is my MDX query: WITH SET [actual - forecast] AS GENERATE( DESCENDANTS([Scenerio Dim].[Scenerio hierarchy].[actual], 0, SELF_AND_AFTER), { ( [Scenerio Dim].[Scenerio hierarchy].CURRENTMEMBER, [Measures].CURRENTMEMBER ) - ( COUSIN([Scenerio Dim].[Scenerio hierarchy].CURRENTMEMBER, [Scenerio Dim].[Scenerio hierarchy].[forecast baseline]), [Measures].CURRENTMEMBER ) } ) SELECT [actual - forecast] ON 0 FROM [actual vs forecast] I get the following error message: Query (4, 14) The function expects a tuple set expression for the 1 argument. A string or numeric expression was used.


View Complete Post


More Related Resource Links

Allmembers function expects a hierarchy expression for the argument, a member expression is used" er

  
  Hi , I have a report that was working before.  After adding couple calculated mesaure, my report is throwing the error.  Here is the query I used.  Can you please help? this was a working prototype, now it is in trouble.  Need to fix it quickly.  thanks a million   SELECT NON EMPTY { [Measures].[sales], [Measures].[%of sales] } ON COLUMNS, NON EMPTY { ([region].[country].[country].ALLMEMBERS * [Fiscal Period].[Fiscal Year].[Fiscal Year].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [sales] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS      

Content page control passes as argument to javascript function

  

Here is the content page:

********************************************************************

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="JavaDynamicCopyValue.aspx.cs" Inherits="JavaDynamicCopyValue" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <script type="text/javascript" >
 function copyValue(input, output )
{
   ouput.value = input.value;
   return true;
}
 </script>
 <asp:TextBox ID="txt1" runat="server" onchange="copyValue(this,document.getElementById('<%=txt2.ClientID%>'))"></asp:TextBox>
    <br />
    <br />
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
</asp:Content>

********************************************************************

I got a javascript run time error says output is undefined. if I view source of the page, the txt1 markup became:

<input name="ctl00$ContentPlaceHol

Function count through Regular Expression

  
Hi, I have a table with varchar(max) column. This column stores all the function calls to application. Example 1    SUM(SALARY); AVG(LEAVES)/COUNT(DAYS); 2    SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES); The above output shows the requests of User 1 and 2. User 1 called SUM, AVG and COUNT functions once. User 2 called SUM once and AVG, Count twice. I need to calculate these counts through Regular expression in SQL Server 2005. Following is script for table and data generation: CREATE TABLE [dbo].[UserRequests] (  [UserID] [int] NOT NULL,  [Requests] [varchar](255) NULL ) ON [PRIMARY] insert into [dbo].[UserRequests] values (1, 'SUM(SALARY); AVG(LEAVES)/COUNT(DAYS);') insert into [dbo].[UserRequests] values (2, 'SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES);') Any suggestion or idea would be highly admired. PS: if someone has another optimized solution for this problem, kindly suggest that as well. Regards.

The expression contains undefined function call MyUserFunction() error :Telerik Reports

  
  Hello All, I am getting the error."An error has occured while processing textbox:The expression contains undefined function call FormType()". I have a report..where in i used a user function called "FormType". My datasource  for teh report is sharepoint list. I am passing a parameter to the user function in the code.My user functions retrieves three values(one each time based on the conditions)But when i select the user function..in the edit expression dialog box.. i am not writing any parameter inside the user function as i am not sure what to write there. I have gone through http://www.telerik.com/support/kb/reporting/designing-reports/the-expression-contains-undefined-function-call-myuserfunction-error.aspx and thought i might fall in 2nd cateogry..but unable to find a solution for that Please help me. Here is the code. InitializeComponent();             string strType;             SPSite oSite = new SPSite("spsiteurl");             SPWeb oWeb = oSite.OpenWeb();             string[] parameters = { "10", "100", "1000" };             T

Cannot perform an aggregate function on an expression containing an aggregate or a subquery

  

How do i get around this???

select

 

sum(PODet.UnitCost*ReceiverDet.Qty2Receive) as TotalCost

 <

How to pass argument to javascript function

  

Hi,

in aspx page i have taken a simple html anchor tag like this:

<a id="l1" href="javascript:OnLookup();">Click</a>


when "Click" is clicked, that OnLookup function is called. But if i want to pass argument in that function then how can i pass ?

This anchor tag is generated dynamically through another javascript function.There can be more than one anchor tags, and each having different arguments in OnLookup function call .

How can pass arguments dynamically ?


Passing grid DataItem as an argument to javascript function.

  

in aspx page

<cmp:MenuItemInfo Text="Delete" onclick="javascript:deleteRow('## DataItem.ClientId ##')" />

 

In Javascript

 

function deleteRow(rowId)

{

Projectgrid.deleteItem(Projectgrid.getItemFromClientId(rowId));

}

but the arument is coming as a string '## DataItem.ClientId ##' instead of correct clientID.

Any help ?

 


Query failed for dataset + The LEFT function requires 2 argument(s).

  

Hi all,

I have a dataset 'DS1' below;which is working fine when i execute the query.

SELECT   Distinct Name
FROM   Project_RPT
WHERE [MonthName]  IN (LEFT(@Month,charindex(' ',@Month)))
AND [YEAR]  IN ( right(@Month,len(@Month)-charindex(' ',@Month)   ) )

 -->@Month parameter gives values as follows:

MAY 2010,MARCH 2010..etc

But when I tried to preview the report, Its giving error :

Query failed for dataset  'DS1' . The LEFT function requires 2 argument(s).

Can anyone help me on this?

Regards,

Bharthi


MDX function for extracting a member set from a tuple set

  

Hello,

I'm looking for a function as explained in the title (that takes the member name as a parameter), or for any other way to accomplish that.

Thanks.

 


SQL PROCEDURE cannot perform aggregate function on expression containing aggregate or subquery

  

Hi I want do SUM(TABLE1.PARAM1)*(SELECT TABLE2.PARAM FROM TABLE 2 WHERE TABLE2.PARAM3=TABLE.PARAM3

I DID BELLOW CODE BUT GETTING ERROR AS cannot perform aggregate function on expression containing aggregate or subquery

YOUR HELP REALLY APRECIATED

 

ALTER PROCEDURE ShowcClientvsTimevsCost(@Country nvarchar(15) )

AS
select  tTIMESHEET.ACTIVITY , sum(REV_BY_CLIENT.Jan+REV_BY_CLIENT.Feb+REV_BY_CLIENT.Mar+REV_BY_CLIENT.Apr+REV_BY_CLIENT.May+REV_BY_CLIENT.Jun+REV_BY_CLIENT.Jul+REV_BY_CLIENT.Aug+REV_BY_CLIENT.Sep+REV_BY_CLIENT.Oct+REV_BY_CLIENT.Nov+REV_BY_CLIENT.Dec) as SUMREVENUE ,
sum(tTIMESHEET.SUN+tTIMESHEET.MON+tTIMESHEET.THU+tTIMESHEET.WED+tTIMESHEET.THU+tTIMESHEET.FRI+tTIMESHEET.SAT)as SUMTIME ,
sum(((tTIMESHEET.SUN)+tTIMESHEET.MON+tTIMESHEET.THU+tTIMESHEET.WED+tTIMESHEET.THU+tTIMESHEET.FRI+tTIMESHEET.SAT)*
(SELECT HR_CHARGE  FROM tEMPLOYEE t  WHERE  t.EMP_ID =tTIMESHEET.EMP_ID ) )as SUMTIMECOST
from tTIMESHEET INNER JOIN REV_BY_CLIENT on
tTIMESHEET.ACTIVITY = REV_BY_CLIENT.Client and REV_BY_CLIENT.Country = @Country
group by ACTIVITY
RETURN 


Custom database function cannot be translated into a LINQ to Entities store expression

  

Hi,

I'm trying to get a UDF from my SQL Server database to map to Linq to Entities. I've found an example for the CourseManager sample in the MSDN :

Private

 

 

Sub Button1_Click(

URGENT HELP NEEDED - RECEIVING ERROR MSG: Procedure or function usp_InsPatient has too many argument

  

error msg detail:

System.Data.SqlClient.SqlException was caught
  class="16"
  ErrorCode=-2146232060
  LineNumber=0
  Message=Procedure or function usp_InsPatient has too many arguments specified.
  Number=8144
  Procedure=usp_InsPatient
  Server=.\sqlexpress
  Source=.Net SqlClient Data Provider
  State=2
  StackTrace:
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnSt

connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly.

  

I dont have the SQL EXPRESS installed instead I have SQL Standard Edition.

 I have two SQL Server instances installed.

 1- UserLT (this is sql 2000)
2- UserLT\SQL2005 (this is SQL 2005 named instance)

But when i try to add a database to my VS website project I get the following error:

Connection to SQL Server files (*.mdf) require SQL server express 2005 to function properly. please verify the installation of the component or download from the URL: go.microsoft.com/fwlink/?linkId=4925

I went in Tools>Opetions>DataBase tools>Data Connection>Sql Server Instance Name (blank for default)

and changed the "SQLEXPRESS" to "USERLT\SQL2005".

But I still get the same error message. Any ideas how i can resolve this issue?


Public Shared function doubt????

  
Hi
I am using VB.net/ASP.NET and SQL Server 2000 for a web application.

For populating the dropdowns, I wrote a Public Shared function LoadDDL(), in which I pass the dataset and dropdown name to set.

I have my doubts that this function will produce unexpected results for concurrent users. And will mix the results among sessions because it is a Shared function.

I am confused here. Is it the right way to go?

Please advice. Thanks in advance.

Pankaj

Trim function in C Sharp

  
Hi,
How do i use "trim" function in C Sharp? I have a string and i want to strip off spaces from the end of the string. Any idea how do i do it??

Thanks
may~

[How??] Lamda expression with ByRef parameter

  

How to write lamda expression with ByRef/ref parameter in c# ??

The code below causing syntax error:

item.OnAction = (p1, p2, ref p3) => {
   .....
   .....
   return true;
};


item.OnAction = (p1, p2, & p3) => {
   .....
   .....
   return true;
};



Express Yourself: Encoding Videos Using Microsoft Expression Encoder 3 SDK

  

Video on the Web involves huge amounts of data. Learn the best way to manage and move that data with the help of Microsoft Expression Encoder 3.

Adam Miller

MSDN Magazine June 2010


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend