dbTalk Databases Forums  

Dimension security at Time Dimension

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Dimension security at Time Dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Resant
 
Posts: n/a

Default Dimension security at Time Dimension - 12-13-2004 , 10:04 PM






How to filter Time Dimension so certain users only can see data before
today (Now-1 day)?

I have Poduct Cube and OrderDate as Time Dimension. My OLAP Cube data
is consumed by internal part and customers. We want to restrict
customers' access right so they cannot see data which order date is
today, they only can see the data that exist before today. How can it
done by using dimension security ?
An example would be greatly appreciated


Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-13-2004 , 11:10 PM






you can use dynamic security
set the allowed members to a formula like this:
{Time.[1990-01-01]:strtomember("[Time]." + VBA!Format(VBA!Now(),
"yyyy-mm-dd"))

(1990-01-01 is the first member of your time dimension)
I have not the VBA function to get the previous day...
maybe:
dateadd("d", -1, now)


"Resant" <resant_v (AT) yahoo (DOT) com> a écrit dans le message de news:
1102997078.673247.198540 (AT) c13g20...oglegroups.com...
Quote:
How to filter Time Dimension so certain users only can see data before
today (Now-1 day)?

I have Poduct Cube and OrderDate as Time Dimension. My OLAP Cube data
is consumed by internal part and customers. We want to restrict
customers' access right so they cannot see data which order date is
today, they only can see the data that exist before today. How can it
done by using dimension security ?
An example would be greatly appreciated




Reply With Quote
  #3  
Old   
Resant
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 01:33 AM



Thanks for ur reply. I've got ur idea (=' '=)


Reply With Quote
  #4  
Old   
Resant
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 09:07 PM



I try to implement your idea, but I prefer to set the denied members -
because it's more simple - with a formula :

StrToMember("[ReceivedDate].[" + "12/14/2004" +"]")

It's work, but when I change it into:

Members("[ReceivedDate].[" + convert(char, Now(), 101 + "]")

It's doesn't work....
Pls help me how to convert Today into "mm/dd/yyyy" format in MDX?
Super Thx


Reply With Quote
  #5  
Old   
Resant
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 10:19 PM



Sorry, it's me again...

I've success in formula syntax :
{StrToMember("[ReceivedDate].[" + VBA!Format(VBA!Now(), "mm/dd/yyyy") +
"]")}

but when I click OK at 'Edit a Database Role' window, there's an error
:
Error occured while processing security for cube 'X' (Security error
[Dimension security: Unable to evaluate MDX expression(s)]...
Please help me out.

Thx a lot


Reply With Quote
  #6  
Old   
Jéjé
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 10:21 PM



use the vba function to format your date to the target format
StrToMember("[ReceivedDate].[" + VBA!Format(VBA!Now(), "mm/dd/yyyy")+ "]")

the convert functiion is an SQL statement, not an MDX function
also, you can use a property in your ReceivedDate dimension.
a property like "Current day" (which contain 0 or 1)
and a formula like this:
filter([ReceivedDate].[Dates],
[ReceivedDate].currentmember.property("Current day") ="1").item(0)

"Resant" <resant_v (AT) yahoo (DOT) com> a écrit dans le message de news:
1103080079.161255.111930 (AT) f14g20...oglegroups.com...
Quote:
I try to implement your idea, but I prefer to set the denied members -
because it's more simple - with a formula :

StrToMember("[ReceivedDate].[" + "12/14/2004" +"]")

It's work, but when I change it into:

Members("[ReceivedDate].[" + convert(char, Now(), 101 + "]")

It's doesn't work....
Pls help me how to convert Today into "mm/dd/yyyy" format in MDX?
Super Thx




Reply With Quote
  #7  
Old   
Jéjé
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 10:24 PM



oups...
filter([ReceivedDate].[Dates].MEMBERS,
[ReceivedDate].currentmember.property("Current day") ="1").item(0)

"Jéjé" <willgart (AT) BBBhotmailAAA (DOT) com> a écrit dans le message de news:
%23BlUM2l4EHA.2288 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Quote:
use the vba function to format your date to the target format
StrToMember("[ReceivedDate].[" + VBA!Format(VBA!Now(), "mm/dd/yyyy")+ "]")

the convert functiion is an SQL statement, not an MDX function
also, you can use a property in your ReceivedDate dimension.
a property like "Current day" (which contain 0 or 1)
and a formula like this:
filter([ReceivedDate].[Dates],
[ReceivedDate].currentmember.property("Current day") ="1").item(0)

"Resant" <resant_v (AT) yahoo (DOT) com> a écrit dans le message de news:
1103080079.161255.111930 (AT) f14g20...oglegroups.com...
I try to implement your idea, but I prefer to set the denied members -
because it's more simple - with a formula :

StrToMember("[ReceivedDate].[" + "12/14/2004" +"]")

It's work, but when I change it into:

Members("[ReceivedDate].[" + convert(char, Now(), 101 + "]")

It's doesn't work....
Pls help me how to convert Today into "mm/dd/yyyy" format in MDX?
Super Thx






Reply With Quote
  #8  
Old   
Resant
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-14-2004 , 11:10 PM



Hi Jéjé,

But I've read that member properties will slow down the performance,
beside that, my time dimension have so many members.
Is there another way without using properties?

Thx a lot


Reply With Quote
  #9  
Old   
Jéjé
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-16-2004 , 06:22 PM



slowing down <> unresponsive ;-)
in your case, dynamic security will take more ressource at the server level,
because AS must create an in memory copy of the dimension to apply the
security.

another way is to use a second time dimension filtered to not display the
current day (using a filter in the source query)
in this case the physical dimension himself doesn't contain the current day.


"Resant" <resant_v (AT) yahoo (DOT) com> a écrit dans le message de news:
1103087406.172133.105270 (AT) c13g20...oglegroups.com...
Hi Jéjé,

But I've read that member properties will slow down the performance,
beside that, my time dimension have so many members.
Is there another way without using properties?

Thx a lot



Reply With Quote
  #10  
Old   
Resant
 
Posts: n/a

Default Re: Dimension security at Time Dimension - 12-17-2004 , 01:11 AM



The first solution's work after I change StrToMember to Members, so the
query will be:
{Members("[ReceivedDate].[" + VBA!Format(VBA!Now(),"mm/dd/yyyy") +
"]")}

But now, the problem is : Today Date is not always exist, so Analysis
Server cannot find dimension member. I try to use 'If function' which
the pseudocode as below :
If Max(ReceiveDate)=Now() Then
Max(ReceivedDate)
Else
-- unfiltered
Is it possible to change it into MDX query? I'm curious....


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.