Monday, March 12, 2012
Find out users in a particular Windows group ?
way to check through SQL which members belong to that group ? Using SQL 2000Hi Hassan,
SQL Server doesn't store which Windows users are in a Windows group. So the
only way to find out is to use the command shell with something like (I
don't know the exact syntax of the NET command):
EXEC xp_cmdshell 'NET GROUP <group name> /DOMAIN'
--
Jacco Schalkwijk
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:e5a3$$rxDHA.1996@.TK2MSFTNGP12.phx.gbl...
> We have our admins create groups containing Windows users ... Is there a
> way to check through SQL which members belong to that group ? Using SQL
2000
>
Friday, February 24, 2012
Find all dimensions with calculated members using AdomdClient
Hi,
I need to find all dimensions in a cube that have calculated members but I can't afford to call GetMembers on every hierarchy level.
Visual Studio lists all the calculations on a cube (calculated members, named sets and script commands) - I'd like to find this information using AdomdClient
Thanks,
James
Background: Our product allows users to drag dimensions onto a report and filter them - we have to write the MDX on the fly to do this - in order to allow filtering of calculated members we need to distinguish if a dimension has calculated members.
> Visual Studio lists all the calculations on a cube (calculated members, named sets and script commands) - I'd like to find this information using AdomdClient
Not possible.
> Background: Our product allows users to drag dimensions onto a report and filter them - we have to write the MDX on the fly to do this - in order to allow filtering of calculated members we need to distinguish if a dimension has calculated members
Can you please clarify in more details what is the special about calculated members so that you want to know in advance whether hierarchy has them.
|||Hi Mosha,
Thanks for the reply, I believe our very own Dave Grant showed you some of RSinteract’s MDX at PASS in Seattle.
We decided that placing the filters in the sub-query allowed us to provide more user friendly totalling (i.e. when filtering row or column attributes). However calculated members are not allowed in sub-queries, so we need to know which Dimension Attributes contain Calc Members and place any filters inline or in a where clause. Our current solution is to have an administrator run an AMO application which saves dimensions with calc members to a config file (AMO must be run with admin privileges).
Cheers,
James
|||What I wonder is why do you want to exclude the entire hierarchy just because it may have calculated members. It seems like if you just wrap the sets that you put inside subselects with StripCalculatedMembers function call, both you and your users will be better of.Sunday, February 19, 2012
Filtering without a tuple-set ?
a normal Filter with a tuple-set:
Filter(
[Brand].members,
(([Measures].[Sale],
[Posting Period].[Year].&[2005]) > 0)
)
The brands where we sold something in the year 2005. This works fine but....
a Filter within a range of days ? :
Filter(
[Brand].members,
(([Measures].[Sale],
ClosingPeriod([Posting Period].[Day]).lag(365):ClosingPeriod([Posting Period].[Day]))) > 0)
The brands where we sold something in a range between currentday -365 days and currentday.
This won't work with the filter-function ! Is there an other way to do this ?
Kind regards
If your Sales measure does not contain negatives you could simply aggregate the measure for the range of dates.
Filter(
[Brand].members,
Aggregate(ClosingPeriod([Posting Period].[Day]).lag(365)
:ClosingPeriod([Posting Period].[Day]
,[Measures].[Sale] ) > 0)
If your measure might contain negative figures and there is a chance that a date range could sum to 0 even though there are sales for the specified period, you might be better off getting a count of the non empty cells.
Filter(
[Brand].members,
NonEmpty(ClosingPeriod([Posting Period].[Day]).lag(365)
:ClosingPeriod([Posting Period].[Day]
,[Measures].[Sale] ).Count > 0)
filtering with set?
i have two dimensions named dimLocation and dimTargetSet. What is needed is to count the members of dimLocation that is also a member of dimTargetSet. I am thinking of using a filter but have no idea what to do.
Count(FILTER(Descendants([dimLocation].currentmember,9,Leaves), ?))
Any ideas?... thank you so much....
Are you saying that both dimensions have the same key values? From your example code, I am guessing that you may be using AS2k (as there are only dimension and no hierarchy references) so I have coded my suggestion below to work on AS2k.
count(filter(descendants([dimLocation].currentmember,,leaves), linkMember([dimLocation].currentmember,[dimTargetSet]) <> NULL))
LinkMember will look for a member with the same key in the other hierarchy.
|||thanks for your reply... i tried it but its not what i need. uhhmmm... what i need to do is to count the members of the first dimension.
count(Descendants([dimLocation].&[2583],9,LEAVES))
But the problem is when we select a member of the second dimension ([dimTargetset])... the second dimension is about location grouping... so if we select a group for west it should only count the members of [dimLocation] that belongs to that group....
Thank you....
|||If targetset is a group of locations, why haven't you just modelled it as an attribute (or level in AS2000) of the location hierarch? Unless there is a many-to-many relationship between targetsets and locations, this would probably be the best way to go.
If you model two items as separated dimensions, then they are, by definition, treated as independent entities.
The only other way to do this would be to count a non-empty measure value
count(filter(descendants(dimLocation.Currentmember,,LEAVES),NOT IsEmpty(Measures.[....])))
If you are using AS2k5 you could use the NonEmpty() function which would be faster in most cases than using filtering.
|||thank you so much for your reply....
filtering with set?
i have two dimensions named dimLocation and dimTargetSet. What is needed is to count the members of dimLocation that is also a member of dimTargetSet. I am thinking of using a filter but have no idea what to do.
Count(FILTER(Descendants([dimLocation].currentmember,9,Leaves), ?))
Any ideas?... thank you so much....
Are you saying that both dimensions have the same key values? From your example code, I am guessing that you may be using AS2k (as there are only dimension and no hierarchy references) so I have coded my suggestion below to work on AS2k.
count(filter(descendants([dimLocation].currentmember,,leaves), linkMember([dimLocation].currentmember,[dimTargetSet]) <> NULL))
LinkMember will look for a member with the same key in the other hierarchy.
|||thanks for your reply... i tried it but its not what i need. uhhmmm... what i need to do is to count the members of the first dimension.
count(Descendants([dimLocation].&[2583],9,LEAVES))
But the problem is when we select a member of the second dimension ([dimTargetset])... the second dimension is about location grouping... so if we select a group for west it should only count the members of [dimLocation] that belongs to that group....
Thank you....
|||If targetset is a group of locations, why haven't you just modelled it as an attribute (or level in AS2000) of the location hierarch? Unless there is a many-to-many relationship between targetsets and locations, this would probably be the best way to go.
If you model two items as separated dimensions, then they are, by definition, treated as independent entities.
The only other way to do this would be to count a non-empty measure value
count(filter(descendants(dimLocation.Currentmember,,LEAVES),NOT IsEmpty(Measures.[....])))
If you are using AS2k5 you could use the NonEmpty() function which would be faster in most cases than using filtering.
|||thank you so much for your reply....
filtering with set?
i have two dimensions named dimLocation and dimTargetSet. What is needed is to count the members of dimLocation that is also a member of dimTargetSet. I am thinking of using a filter but have no idea what to do.
Count(FILTER(Descendants([dimLocation].currentmember,9,Leaves), ?))
Any ideas?... thank you so much....
Are you saying that both dimensions have the same key values? From your example code, I am guessing that you may be using AS2k (as there are only dimension and no hierarchy references) so I have coded my suggestion below to work on AS2k.
count(filter(descendants([dimLocation].currentmember,,leaves), linkMember([dimLocation].currentmember,[dimTargetSet]) <> NULL))
LinkMember will look for a member with the same key in the other hierarchy.
|||thanks for your reply... i tried it but its not what i need. uhhmmm... what i need to do is to count the members of the first dimension.
count(Descendants([dimLocation].&[2583],9,LEAVES))
But the problem is when we select a member of the second dimension ([dimTargetset])... the second dimension is about location grouping... so if we select a group for west it should only count the members of [dimLocation] that belongs to that group....
Thank you....
|||If targetset is a group of locations, why haven't you just modelled it as an attribute (or level in AS2000) of the location hierarch? Unless there is a many-to-many relationship between targetsets and locations, this would probably be the best way to go.
If you model two items as separated dimensions, then they are, by definition, treated as independent entities.
The only other way to do this would be to count a non-empty measure value
count(filter(descendants(dimLocation.Currentmember,,LEAVES),NOT IsEmpty(Measures.[....])))
If you are using AS2k5 you could use the NonEmpty() function which would be faster in most cases than using filtering.
|||thank you so much for your reply....