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

Post New Web Links

How to execute a formula through all children measure's values in the current context

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server

Hi, I have a cube with the following dimensions and measures:


The [Answer] measure is a integer value between 0 and 10.
My goal is to create a custom calculated member that return's the answer that
most appears in the current context. I don't know the correct math function's
name in english, but in portuguese is called as "MODA".

I've used the following sintaxe to calculate the STDEVP and I need to
reproduce some similar behavior that the STDEVP internaly's uses to navigate
through all children values and calculate the standard deviation:
STDEVP( [DimAnswer].Children, [Measures].[Answer])

Could someone please help me?

Oberdan Borges Nunes

View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

CS0103: The name 'Helper' does not exist in the current context


Hey i have a Class named Helper.cs inside my App_Code folder.

And i get this error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0103: The name 'Helper' does not exist in the current context

Source Error:

Line 26:         {
Line 27:             SqlConnection con = new SqlConnection(Helper.ConnectionString());

The name 'User' does not exist in the current context.


Hey guys,

I've got a literal control to display the username of the user logged into our companies intranet system, originally I had a LoginName control but couldn't get strip to remove the domain from the username (as the format is domainname\username) so I'm trying it this way.

    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

        if (Parts.Length == 2)
            loginName.Text = Parts[1];
            loginName.Text = User.Identity.Name;


    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

Login control - Controls do not exist in current context

Hi all,Trying to set up the Login control as a User control, but none of the controls exist in the current context?None of my code below is recognised? What's going on here please? I've rebuilt the solution many times.if (Membership.ValidateUser(this.UserName.Text, this.Password.Text))        {            FormsAuthentication.RedirectFromLoginPage(UserName.Text, RememberMe.Checked);        }        else        {             Msg.Text = "Login failed. Please check your user name and password and try again.";        }

The name 'InitializeComponent' does not exist in the current context

Hello!I'm creating  a control library and consequently a class.Visual studio compiler is giving my followed error, when I wrote InitializeComponent();The name 'InitializeComponent' does not exist in the current contextCan anybody help me please?

Compiler Error Message: CS0103: The name 'lblRegion' does not exist in the current context

i am gettign this error Compiler Error Message: CS0103: The name 'lblRegion' does not exist in the current context Source Error: Line 31: {Line 32: Line 33: lblRegion.Text = dt.Rows[0]["RegionName"].ToString();Line 34: lblCountry.Text = dt.Rows[0]["CountryName"].ToString();Line 35: lblCountryCode.Text = dt.Rows[0]["CountryCode"].ToString(); this is source code:using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Net;using System.Xml;public partial class CSharp : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {        //Get IP Address        string ipaddress;        ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];        if (ipaddress == "" || ipaddress == null)            ipaddress = Request.ServerV

How to get values from a multi row set in case of Execute SQL task?

Hi All, I'm testing the Execute SQL task, when I set the ResultSet to Full row set an try to retrieve those set into a variable, the package runs well but I' m not able to extract what is inside the record. If I try to debug the package to explore the data. All that I recieve is _ComObject as type, System._ComObject as value, I know (if I'm not wrong) that this _ComObject is the box that contains the rows though the values the question is how to extract those variables. For example, I can say how to enumerate the results sets using a ForEach container? Thank you The complexity resides in the simplicity

Measure value that ignores custom rollup formula

I have dimension with parent-child defined and I also have customrollupcolumn set for the parent. I have a measure which I need to get WITHOUT customrollup formula affecting the value. Any help is appreciated. Thanks

How to Get Values from Current Row of a gridview

hallo all.. how can i access my gridview so that i can get the current row column values..pls help me

Null values in formula fields

Hi,I tried using this and am concatenating the fields together.  It does not appear to be working.  Here's what I have.  Any suggestions?   IIF(IsNull({nomination.recparty1}), '0.0', {nomination.recparty1} ) &  chr(13)IIF(IsNull({nomination.recparty2}), '0.0', {nomination.recparty2} ) & chr(13)IIF(IsNull({nomination.recparty3}), '0.0', {nomination.recparty3} )andif IsNull({nomination.recparty1}) then '0.0' else {nomination.recparty1} & chr(13)if IsNull({nomination.recparty2}) then '0.0' else {nomination.recparty2} & chr(13)if IsNull({nomination.recparty3}) then '0.0' else {nomination.recparty3}Both this gets failed beacuse my fields are returned as null.Please get me to solve this.Thanks in advance.Regards,Mugil

The name 'id' does not exist in the current context


        int Id = Convert.ToInt32(ddlCardDetails.SelectedValue.Split('|')[0]);
        tbl_Payment democustomer = ctx.tbl_Payments.SingleOrDefault(c => c.ID == id);


Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'id' does not exist in the current context

Source Error:

Line 523:
Line 524:        int Id = Convert.ToInt32(ddlCardDetails.SelectedValue.Split('|')[0]);
Line 525:        tbl_Payment democustomer = ctx.tbl_Payments.SingleOrDefault(c => c.ID == id);
Line 526:
Line 527:

Selecting current,previus month values


hi friends,

consider that i have columns like tax_amount,item_amount,month,year in a table..

i want to get

current month & year - tax_amount,item_amount

previus month and current year- tax_amount,item_amount

current month &  previus year - tax_amount,item_amount

how to get all the values in a single select query.

i am waiting for ur reply..

The name 'Profile' does not exist in the current context


So, I'm using the .NET 2.0 Profile object to manage custom user data on an internal site for my company. Everything seems to be working flawlessly until I realized I was going to have to add a redundant block of code to every aspx page in order to take advantage of the Profile.

At this point I decided to create a custom base page that could be inherited by all of my aspx pages. Seemed like the right idea, until I got the above error:


The name 'Profile' does not exist in the current context


I might be missing out on how/when the Profile object is getting built but I was wondering if anyone had any suggestions on how to access the Profile object from a base page/class.

Repeater Control Does not exist in current context, but other controls do


I have an aspx page containing a number of asp:Repeater Controls.

Im not using the default code-behind file that is generated, ive changed this to file in a different folder.

In the code-behind, i populate the repeater controls, all was workign fine until i added another repeater control to the aspx page.
In the code-behind, the intellisense picks up this control and i can access its methods and properties to set the datasource and bind the data. However, when i go to build the project, i get an error "The name Repeater1 does not exist in the current context"

Firstly, all the other repeater controls, declared in exactly the same way, do not throw throw this error.
Secondly, yes the repeater does have a runat="server" tag.
Thirdly, It is not inside any other controls.

I have tried various different methods of accessing this repater instead of just "Repeater1." but each returns null:

Repeater r1 = (Repeater)Page.FindControl("Repeater1") ;
Repeater r1 = (Repeater)Page.Master.FindControl("Repeater1"); 
Repeater r1 = (Repeater)Master.FindControl("Repeater1") ;

Ive no idea why this "doesnt exist in the current context" as all the other controls on this page do, even if i create a literal i get the same problem

'Session' does not exist in the current context


In my application I am trying to read and write session variables in a class file using C#.  What do I need to use to access the Session variables?

SPD 2010 reusable workflow not picking up Current Item values


Hi, I have created an SPD 2010 reusable workflow that is attached to a specific content type...such content type is derived from a published InfoPath form with some of its fields being promoted, like the "Approvers" fields.

In SPD 2010, I add the " Start Approval process on Current Item with 'Participants' " action...those Participants I get (or at least I want to) from the Current Item: ApproversField.

After saving and publishing the workflow, I use the content type (set as default) in a form library and then add the workflow to it. After creating an Item the workflow is automatically rejected.

I checked the Workflow History and I realized the participants are not being picked from the current item's field... weird thing is, if I try the very same actions/etc in a workflow that is attached to that list everything works perfect... I tried to log messages all around the workflow process but the values never get picked up...

What am I missing here?

Thanks in advance.

Named Set and Calculated Measure returns #Error values


I'm trying to create a set of measures that will give me a count of how many customer have bought a product that falls in to different levels in a heirarchy (Department -> Category )

I have a fact table that contains OrderDetail records at the SKU level.

My Product dimension contains the hierarchy assoicated to each SKU

My 3 measures are

Measure 1 -  number of items >= 1 and <= 3

Measure 2 - number of items >=4 and <=7

MEasure 3 - number of items >= 8

I have created a names set to cross join all the members in the product hierarchy with the customers





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