MDX get member properties
Context: SSAS 2005.
How to get a property of a member? Is it member.property? I have seen member.properties() . When to use member.property and when to use member.properties()? I thought they are interchangeable then found they are not. E.g. Q1 and Q2 return the same result.
Q3 works but Q4 won't compile. Can someone explain this?
Q1:
with member [measures].parentname as
[Product].[Product Categories].CurrentMember.Parent.PROPERTIES("name")
select
[measures].parentname on 0,
[Product].[Product Categories].[SubCategory].members on 1
from [Adventure Works]
Q2:
with member [measures].parentname as
[Product].[Product Categories].CurrentMember.Parent.name
select
[measures].parentname on 0,
[Product].[Product Categories].[SubCategory].members on 1
from [Adventure Works]
Q3:
with member [measures].parentKey as
[Product].[Product Categories].CurrentMember.Parent.PROPERTIES("KEY")
select
[measures].parentKey on 0,
[Product].[Product Categories].[SubCategory].members on 1
from [Adventure Works]
Q4:
with member [measures].parentKey as
[Product].[Product Categories].CurrentMember.Parent.KEY
select
[measures].parentKey on 0,
[Product].[Product Categories].[SubCategory].members on 1
from [Adventure Works]
I'm not 100% clear on the difference, as I recall properties() returns a string and .property can return another datatype.. this is just from memory. Why don't you try MEMBER_KEY for q4... did you look at the list of member properties?
-Ken
Similar Messages
-
SSRS MDX Query Dimension Properties Missing
I have been stumped on this for a few days thought I'd throw this out here. I've read every related article in the forum regarding MDX Queries and Dimension Properties in SSRS Report Developer and haven't found a case exactly like this with a solution that
works.
Environment is SQL 2012 SP1 Cum update 5
I am doing a rather generic query out of MS Project Servers OLAP cube and I can't get the dimension properties to show up in the flattened output for my dataset. See below.
SELECT
NON EMPTY { [Measures].[FTE est] } ON COLUMNS,
NON EMPTY {
[Value_Stream_Project].[Value_Stream_Project].ALLMEMBERS *
[Project Status_Project].[Project Status_Project].ALLMEMBERS *
DESCENDANTS([Project List].[Project List Level 02].ALLMEMBERS)*
DESCENDANTS([ProjectManager_Project].[ProjectManager_Project Level 02].ALLMEMBERS) *
[Planner_Project].[Planner_Project].ALLMEMBERS *
[Time].[Month].ALLMEMBERS
DIMENSION PROPERTIES
MEMBER_CAPTION,
MEMBER_UNIQUE_NAME,
PARENT_UNIQUE_NAME,
LEVEL_NUMBER ,
[Project List].[Project List Level 02].[Start Date],
[Project List].[Project List Level 02].[Finish Date]
ON ROWS
FROM (
SELECT ( STRTOMEMBER(@FromTime, CONSTRAINED) : STRTOMEMBER(@ToTime, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@RBSResource, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@ProjectStatusProject, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@ValueStreamProject, CONSTRAINED) ) ON COLUMNS
FROM [MSP_Portfolio_Analyzer]))))
My issue is the [Project List Level 02] dimension Properties (below) are not showing up in the Query designer output, aren't being generated as fields in the dataset and can't be referenced as a property in an expression (i.e. Fields!Project_List("Start
Date") )
[Project List].[Project List Level 02].[Start Date],
[Project List].[Project List Level 02].[Finish Date]
The odd part is if I change the above two rows in my query to this :
[Project List].[Start Date],
[Project List].[Finish Date]
The Query designer shows the properties in the output but leads to 2 other issues,
1) I have to modify the generated Dataset field values to remove the [Project list Level 02] in the Level unique name like this
Before<?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List].[Project List Level 02]" />
After
<?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List]" />
2) I have to restrict my cross join to only the current level (Level 02) or it expands the results to the parent hierarchy of the Project List dimension and skews my measure summaries.
I've tested the query in SSMS directly and the properties are showing up just fine for those dimensions using the original syntax.
Any help would be appreciated.Hi there,
Which data source provider are you using? Are the connection strings used in SSMS the same as SSRS? Doing a profiler trace against Analysis Services might point to differences in how the connection is made or query is parsed.
This may help.
http://www.sqlchick.com/entries/2011/10/23/pros-cons-of-using-the-ole-db-provider-for-ssas-100-when-rep.html
Did you try using With clause to make a friendly name for the member properties?
http://melick-rajee.blogspot.ca/2012/04/how-to-get-member-properties-in-mdx.html
cheers,
Andrew
Andrew Sears, T4G Limited, http://www.performancepointing.com -
Hi Expert
I have a mdx:
with member
[PLANITEM].[H1].[ccc] as
'[time].[h1].currentmember.properties("DAYS")' ---> this one cannot get property value
member
[PLANITEM].[H1].[aaa] as
'[time].[h1].currentmember.properties("level") --> this one ok .....
What I want to get is the current month days for further calculation. In my TIME dimension already include properties("DAYS")'
I am just can get all other PROPERTY value , EXCEPT property "DAYS" .why??
any idea??
Thanks..Go into Admin...Click on the Dimension, then do Maintain Dimension Properties....and make sure that the "InApp" box is checked next to the "DAYS" property.
You will need to then process the dimension since it is a structural change. Full process.
Please let me know if this resolves your issue.
Greg -
BPC 7.5 - Member properties disabled (grey marked)
Since the upgrade to BPC 7.5 some of the member properties are greyed (disabled).
Is it possible to change this setting somewhere?Hello Martin,
now it's clear your question. The greyed properties don't have the check on the InApp properties of the dimension, so they aren't available in the OLAP and you can't use they in MDX functions or instructions.
If you need some of these properties on the OLAP you must go on admin console\modify dimension, check "modify dimension property" on step 2, click on step 3 and check the InApp for these properties, so they will be black.
Kind regards
Roberto
Edited by: Roberto Vidotti on Jan 31, 2012 12:06 PM -
Repeated Header Row within a Details Section Only of a Group Ignores Tablix Member Properties
Ok. I have a situation where I have a details section of a group, and I am trying to get it to repeat the row headers on each page. It's not working. I've gone into Advanced Mode, and addressed the static Tablix Member for the left-most
field of the header row in question, set the properties for the Tablix Member to "RepeatOnNewPage: True" and "KeepWithGroup: After", and still, it refuses to repeat the row header for these details. I've tried rebuilding and
not deleting the column where the grouping was originally assigned (without deleting the grouping, of course), and assigned the properties for "RepeatOnNewPage" to that left-most, grouping field, yet I get the exact same results. I've looked
up solutions, and even spoken to the expert of experts, but no joy here. I'm using VS'10.OK. So it is fixed... sort of...
Apparently, you must select to add group headers repeated as you create the group (inc. child group), BESIDES changing in Advanced Mode, Tablix Member /Properties / etc. Then you have to format that extra column within your Tablix to
make it appear to 'disappear'. BUT EVEN THEN, there is a new problem:
The headers will repeat on the additional pages, but only to a point. For some odd reason, SSRS doesn't consistently render the repeated headers of the group details for
every page, just where it is a hard (page) break, as opposed to a soft (page) break. My gut tells me that this has nothing to do with the .xml code, but is an SSRS idiosyncrasy. -
How to get all properties for an item with search?
How can I get all crawled / managed properties back of an item with the search API (REST, client, or server)?
Currently I am only aware of specifying the applicable properties specifcally by using the selectproperties parameters via REST:
http://host/site/_api/search/query?querytext='terms'&selectproperties='Path,Url,Title,Author'
(taken from http://blogs.msdn.com/b/nadeemis/archive/2012/08/24/sharepoint-2013-search-rest-api.aspx)
I don't want to do this. I just want to get all properties back that
are associated with the search results.Its my understanding that standard managed properties will be returned, like: Created Date, Last Date Modified, Author, Title, etc. However, if you need more than that you will need to specify the properties to return.
This blog post also has a similar thought process:
http://www.blendmaster.net/blog/2012/09/view-managed-property-value-in-sharepoint-2013-using-search-rest-api/
Brandon Atkinson
Blog: http://brandonatkinson.blogspot.com -
SSIS 2012 Script Task to Get File Properties
Hello,
I researched on how to grab a file properties such as file size, file modified date, etc and I came across the following
link:
I followed exact steps and when I went to execute the package, I got the following error:
Below is the code:
// C# code
// Fill SSIS variables with file properties
using System;
using System.Data;
using System.IO; // Added to get file properties
using System.Security.Principal; // Added to get file owner
using System.Security.AccessControl; // Added to get file owner
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
namespace ST_cb8dd466d98149fcb2e3852ead6b6a09.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
public void Main()
// Lock SSIS variables
Dts.VariableDispenser.LockForRead("User::FilePath");
Dts.VariableDispenser.LockForWrite("User::FileAttributes");
Dts.VariableDispenser.LockForWrite("User::FileCreationDate");
Dts.VariableDispenser.LockForWrite("User::FileExists");
Dts.VariableDispenser.LockForWrite("User::FileInUse");
Dts.VariableDispenser.LockForWrite("User::FileIsReadOnly");
Dts.VariableDispenser.LockForWrite("User::FileLastAccessedDate");
Dts.VariableDispenser.LockForWrite("User::FileLastModifiedDate");
Dts.VariableDispenser.LockForWrite("User::FileOwner");
Dts.VariableDispenser.LockForWrite("User::FileSize");
// Create a variables 'container' to store variables
Variables vars = null;
// Add variables from the VariableDispenser to the variables 'container'
Dts.VariableDispenser.GetVariables(ref vars);
// Variable for file information
FileInfo fileInfo;
// Fill fileInfo variable with file information
fileInfo = new FileInfo(vars["User::FilePath"].Value.ToString());
// Check if file exists
vars["User::FileExists"].Value = fileInfo.Exists;
// Get the rest of the file properties if the file exists
if (fileInfo.Exists)
// Get file creation date
vars["User::FileCreationDate"].Value = fileInfo.CreationTime;
// Get last modified date
vars["User::FileLastModifiedDate"].Value = fileInfo.LastWriteTime;
// Get last accessed date
vars["User::FileLastAccessedDate"].Value = fileInfo.LastAccessTime;
// Get size of the file in bytes
vars["User::FileSize"].Value = fileInfo.Length;
// Get file attributes
vars["User::FileAttributes"].Value = fileInfo.Attributes.ToString();
vars["User::FileIsReadOnly"].Value = fileInfo.IsReadOnly;
// Check if the file isn't locked by an other process
try
// Try to open the file. If it succeeds, set variable to false and close stream
FileStream fs = new FileStream(vars["User::FilePath"].Value.ToString(), FileMode.Open);
vars["User::FileInUse"].Value = false;
fs.Close();
catch (Exception ex)
// If opening fails, it's probably locked by an other process
vars["User::FileInUse"].Value = true;
// Log actual error to SSIS to be sure
Dts.Events.FireWarning(0, "Get File Properties", ex.Message, string.Empty, 0);
// Get the Windows domain user name of the file owner
FileSecurity fileSecurity = fileInfo.GetAccessControl();
IdentityReference identityReference = fileSecurity.GetOwner(typeof(NTAccount));
vars["User::FileOwner"].Value = identityReference.Value;
// Release the locks
vars.Unlock();
Dts.TaskResult = (int)ScriptResults.Success;
Eventually I am looking to just grab the Modified Date from the Windows Explorer folder and insert into table. Any suggestions? Thank you in advance!
Sanjeev
Sanjeev JhaHi SSISJoost,
I am so glad you responded to this thread. You are absolutely right. I copied the entire code including the project name (guid) and that solved the error problem.
Now, what did you do to get the message box? I added the watch and I could see the values but how do I get these values in a table? If I remember correctly, in your blog, you mentioned something about using derived columns. I am familiar with Derived Columns
but how do I do that? I appreciate your response.
Thank you.
Sanjeev
Sanjeev Jha
I used a second script task to show all variable values. It has a
MessageBox in it and between all
variables I added a
newline to make it more readable...
But with an Execute SQL Task and parameters you can also put these values in a Table... or you can read the file in a Data Flow Task and add those variables (as metadata) to each record with a Derived Column
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter -
How to get Node Properties by js script?
I have a customised client script implementing some functions similair to "CQ.wcm.SiteAdmin.scheduleForActivation".
But when the user trigger the dialog and before the submission, I'd like to do some processes with the properties of some nodes (components in some parsys).
My question is... I know in .jsp, I can get the properties of a node by node.getProperty("someProp");
But... How can I achieve the same result in .js scripts?Hi Matthias,
I am also facing same scenario. Could you please tell me how you resolved this or did you able to find out any alternative for this. Please help me.
Regards,
Mahidhar,
[email protected] -
Getting attribute properties from client tier is too slow
Getting properties for view object attributes is too slow, because a called to the server is made for every attribute.
I noticed that when a property is gotten for an attribute all properties are retrieved for it, but I couldn't found a way to get all properties for all attributes in the ViewObject.See ApplicationModule.fetchAttributeProperties and it's usage in JClient in JDeveloper 9.0.3
-
BAPI to get all properties of all levels of all hierarchies of a cube
Hi Experts,
Is there are way to get all properties of all levels of all hierarchies of all dimensions of a cube (InfoCube, ODSObject, QueryCube, InfoSet) in one BAPI call?
I use BAPI_MDPROVIDER_GET_PROPERTIES, and only set input parameters: CAT_NAM, CUBE_NAM. But it only returns all Level1's properties.
Any useful answer will be awarded with suitable points.
Thanks,
RohanHi,
Thanks for giving reply.
Recommended Function module is not a RFC, so it is not working.
Thanks,
Rohan -
When i try to use Ge-member command in ISE it not work but it work without ISE ...?
PS C:\> Get-WindowsFeature | Get-Member
Get-WindowsFeature : The target of the specified cmdlet cannot be a Windows client-based operating system.
At line:1 char:1
+ Get-WindowsFeature | Get-Member
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : DeviceError: (localhost:String) [Get-WindowsFeature], Exception
+ FullyQualifiedErrorId : WindowsClient_NotSupported,Microsoft.Windows.ServerManager.Commands.GetWindowsFeatureCommandwhen i try to access my core server from my domain using power shell i get error
PS C:\> Enter-PSSession -ComputerName WIN-CORE -Credential 0SGMS\bhagwatritesh
Enter-PSSession : Connecting to remote server WIN-CORE failed with the following error message : WinRM cannot process
the request. The following error with errorcode 0x80090311 occurred while using Kerberos authentication: There are
currently no logon servers available to service the logon request.
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are specified.
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does not exist.
-The client and remote computers are in different domains and there is no trust between the two domains.
After checking for the above issues, try the following:
-Check the Event Viewer for events related to authentication.
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or
use HTTPS transport.
Note that computers in the TrustedHosts list might not be authenticated.
-For more information about WinRM configuration, run the following command: winrm help config. For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName WIN-CORE -Credential 0SGMS\bhagwatritesh
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (WIN-CORE:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed -
I'm trying to find a way to get member names such as the Esscmd "Getmembers" does. Can someone please post an example. Thanks.
The following getDimentions() returns all members in XML format, it was just writen by myself yesterday :)public String getDimentions() throws EssException{ String xml = "<?xml version=\"1.0\" encoding=\"GBK\"?>\n"; String s; IEssCubeOutline outline = curCube.openOutline(); IEssIterator dims = outline.getDimensions(); xml = xml + "<!-- Listing dimentions for cube ["+ curCube.getApplication().getName()+"."+curCube.getName()+"]. -->\n\n"; xml = xml + "<Dimensions>\n"; for (int i=0; i<dims.getCount(); i++) { IEssDimension dim = (IEssDimension)dims.getAt(i); s = getDimentions_helper(dim.getDimensionRootMember()); xml = xml + s; } xml = xml + "</Dimensions>"; return xml;}private String getDimentions_helper(IEssMember mbr) throws EssException{ String ret = ""; for (int i = 0; i < mbr.getGenerationNumber(); i++) ret = ret + "\t"; IEssIterator mbrs = mbr.getChildMembers(); if (mbrs.getCount()==0) { ret = ret + "<Member name=\"" + mbr.getName() + "\" gen=\""+String.valueOf(mbr.getGenerationNumber())+"\" />\n"; } else { ret = ret + "<Member name=\"" + mbr.getName() + "\" gen=\""+String.valueOf(mbr.getGenerationNumber())+"\">\n"; for (int i = 0; i < mbrs.getCount(); i++) { ret = ret + getDimentions_helper((IEssMember)mbrs.getAt(i)); } for (int i = 0; i < mbr.getGenerationNumber(); i++) ret = ret + "\t"; ret = ret + "</Member>\n"; } return ret;}
-
Movie/Get Movies Properties Menus
Hello,
Wanted to ask is there a difference with Quicktime Pro 7 between a PC and Mac? I run a PC with Quicktime Pro 7 I am working on a web course for audio and video and my instructor wrote in the instructions to click on the Movie/Get Movies Properties menus and then from there selcting Sound Track and then click on General from the two drop down menus.
All I have in mine is when the file is opened to click on the Window Menu and then click on the Show Movie Info menu to record the data such as data size and data rate. As I am doing some analyzing on various codecs and audio formats to see if the file will or will not retain their sound quality when compressed at various rates. So for me is this how it is for the PC? I see that it records the data rate and data size in KB don't know wheather it's kilobytes per second or kilobits per second for the data rate. As for the data size shows KB I would think that's kilobytes but my instructor wants me to write it in the form as an example 111.1k looks I might have to convert.
Any help or feedback would be greatly appreciated.
Thanks alot,
RyanSuggest you try importing your movies with free OPlayerHD Lite via iTune File Sharing.
https://itunes.apple.com/sg/app/oplayerhd-lite-best-free-video/id385896088?mt=8 -
Hi there,
I just wanted to share this old blog post in case no one knew about this here (like i didn't). I have no affiliation with this person, i just think its great!
Getting Device Properties like OS,Model,Brand,SDK,Version and CPU on Air for Android
http://www.funky-monkey.nl/blog/2010/11/11/getting-device-properties-like-os-model-brand-s dk-version-and-cpu-on-air-for-andoid/
I was able to correctly identify DroidX and Motorola Xoom family edition in my test, with no ane, pretty cool!Okay. I've found an answer:
yes, you can and have to add these icons via the descriptor file, since flash wont let you. But before you do that, go into the "Air publish" settings in flash. Here, right on page 1, there is the "include files" section. Add your icon pngs there. Hit OK and exit these settings. Now open the descriptor with an editor outside of flash and write in the files like I posted above. Close. Save. Make it write protected. No go to flash and publish. -
How to get System Properties using Applet Program
Eg(username) of the systemFrom applet, u cannot access some system properties... to do this u have to give permissions in java.policy file
arun
Maybe you are looking for
-
Hi All. In iPhoto I have lost the double click that opensup photos, the double click now appears as a ! in a triangle. At the same time I have lost the print facility in iPhoto. This happened out of the blue and I have been unable to reconcile either
-
Boot problem: sometimes I get a folder with a question mark at start up
I am having a problem lately which I think might be hardware related. I get a question mark in a folder icon on start-up This happens randomly. In most occasions it occurs when I do a cold boot (so the system has been off for a while). As soon as I s
-
Iweb files are missing - can Time Capsule restore them?
All of my iWeb files are missing. How can one find these files in Time Capsule and restore them? Thanks, José
-
I'm developing an IRC applet with SSL sockets. I've reaches to make a connection with the IRC server, but when i try to send login to the server, i take the next exception: IOException: javax.net.ssl.SSLException: Connection has been shutdown: javax.
-
Migrating EBS from NFS to OCFS partiton
Hi, Environment : 2 node RAC with PCP and 2 node (non rac) web and forms Oracle database 10.2.0.4 and EBS: 12.0.6 OS: OEL 4 We currently have our concurrent processing part on /erpp partition which is NFS now we wish to move it to OCFS partition /erp