Dimensions attribute depending Locale Identifier - ssas

I want to know if it is possible to show different dimensions attributes depending the locale identifier.
That is the connection string using ADOMD.NET.
string connectionString = "Provider=MSOLAP;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Catalogo;Data Source=SQlserver;Locale Identifier="+language;
For example if I connect with language = 3082(ES), I want to show only one dimensions attribute, and if y change the language i will show another.

Translations inside Analysis Services let the cube developer define the Spanish (and other languages) translations for metadata and the actual dimension member names. Is that what you want? Or do you want to trim down the list of dimension members a user sees based upon the language of their computer?
I don't know of a way of easily retrieving the current Locale Identifier on the current connection. Maybe a .NET sproc that runs inside SSAS would let you figure this out, but I'm not sure I'd recommend that.
I tried creating a role in the Adventure Works sample cube which uses this expression for the Dimension Data security on the [Geography].[Country] attribute:
Filter([Geography].[Country].[Country].Members,[Geography].[Country].CurrentMember.Name = [Geography].[Country].CurrentMember.Member_Caption)
That code is just a conceptual test not something you'd use as is. That code, if it worked, would only let a user see any countries where the translated name (Member_Caption) matches the English name. For example, in the Adventure Works cube, Canada is the english name and Canada is also the Spanish translated name for the country. But that code didn't work because I believe the translations aren't in effect at this point in the connection when the role based security is applied.
So I'm struggling to see how you can accomplish what you're wanting. Maybe someone else will have an idea.

Related

Masking Dimension attribute / Security in SSAS

We have a cube where we implemented the dimension data level security based on ROLE. This security is working fine where we are restricting the user to see his records only. Now the Customer dimension has another Employee attribute. Based on the value of this field we want to restrict other dimension attributes. Like in the below example Manager_Id is the attribute that should be masked. We want to mask the attribute value of this field with "Employee” so that the restricted user only sees a masked attributes value.
Note: Both the attribute from the same dimension
User is allowed to see employee data
Name Manager_ID
Jon 123456
If the User is not allowed to see then the attribute value needs to be masked with Employee
Eg:
Name Manage_ID
Jon xxxxx
Thanks
Jay
If I'm interpreting your question correctly you're trying to disable a value in a dimension based on the user querying the dimension/cube. Unless you've build your own version of excel where you would add those overrides you should use different roles for the different types of users that use your application.
While I don't know how and if you can mask a value, you can use attribute security to disable the role from viewing the contents of a certain attribute of a dimension.
To do this from SQL Server Management Studio you can open the properties of a role, go to the dimension data tab and select the cube and dimensions you want to filter.
Warning: you can't disable values in a dimension, then the user will still be able to query them, you'll need to scroll down to the cubes and edit the dimension there.
(it's a long list of first your dimensions and then your cubes which can be extended to show the cubedimensions, which are the only thing relevant to us right now)
When you have the correct dimension you can select an attribute Manager_ID in your case and disable all values a user shouldn't be able to see. You can do this by unchecking all restricted values or deselect all members and then click the ones that should be available. That all depends on your useCase.
The result of this will be that when opening the dimension from excel or powerBI the disabled values won't show.
I hope this helps and good luck.

How to get "Generated By" field in Webi?

In my WebI Report I would like to print the Author or the Last modified User name.
How can I obtain it?
Have a look at the manual Using functions, formulas and calculations in Web Intelligence, which contains a reference information regarding functions you'd need to retrieve this information. You can find the manuals for your specific version of BusinessObjects on help.sap.com.
The functions you're probably looking for are DocumentOwner() and DocumentAuthor().
Update:
While you can't retrieve the user's full name in Web Intelligence, there is a workaround, provided that
You're using third-party authentication (e.g. Windows AD)
You're able to pull the full name from that source into the CMC
If so, you can use User Attribute Management to define a new user attribute in the CMC and then create a new dimension in your (UNX) universe which uses the #Variable to get in the new user attribute value.
From the IDT manual (paragraph 18.3.6 About #Variable, version BI 4.1 SP5):
To reference a User Attribute, specify the internal name for the at­
tribute as it is defined in the CMC. #Variable returns the value of
the attribute for the current user. For example, the User Attribute
MYCOUNTRY contains the value of the country of each user in the CMC.
Specify the attribute's internal name surrounded by single quotes:
#Variable('SI_MYCOUNTRY')
The attribute’s internal name is defined when the attribute is cre­ ated in the CMC
User Attribute Management is described in the Administrator Guide, paragraph 6.2.17 Managing attributes for system users (version BI 4.1 SP5).

Get geo-locations from cities

I am trying to display a list of closest restaurants of a given city within a radius. In order to do this, I'll have to convert the city to a longitude/latitude.
When the user fills in his/her restaurant information, he/she will fill in the address. Based on that address i need to get a longitude/latitude and save that to the database.
I don't need to point this on a map. I'll be just displaying a list of all closest restaurants within the given radius to the user.
How can I do this with ASP.NET-MVC4?
Also, this project is based on Code First. And for address I have DbGeography as datatype set.
The project is kind of based on this tutorial
Edit
To avoid anyone else telling me this is not possible with ASP.NET on it's own, I am aware of that. an example with Google maps / .NET wrapper would be great.
This query itself is typically done in the database back-end because the program is the consumer of the data not the keeper of the data. You will have a table of restaurants, possibly for many cities, each restaurant having a latitude and longitude. You create a geospatial index on the table, which performs a tesselation for performance; you configure the tesselation parameters. You must determine the latitude/longitude of your restaurant-seeker's location. Your command object would feed that data to a stored procedure, along with the desired radius. The stored procedure would return an enumerable set of rows to your client program.
I found this .NET wrapper which fulfills my need.

Localisation of country names

As part of addresses I am storing in my SQL database country codes (e.g. US, DE,...). I then have another table (with two columns) in my database which translates the country codes to the English language names of the respective countries.
If I want to make the site multi-language, I could expand this translation table adding country names in other languages than English.
I was wondering if there is another method which does not involve modification of the database, e.g. using gettext to translate the English country names?
The typical way to handle this is to change the table structure to have three columns, instead of two:
Language
CounryCode
FullName
Whenever you query the database, you would provide the current language.
You then have to change your code to include the additional language key in any queries.
Depending on how you are going to keep track of the current language, you would also use a view or user defined function.
You don't want to use automated translation, since the name of a country like "China" could turn into the equivalent of "porcelain".

How to name my enum elements?

I have a problem naming the elements in my application's data model.
In the application, the user has the possibility to create his own metamodel. He does so by creating entity types and a type defines which properties an entity has. However, there are three kinds of entity types:
There is always exactly one instance of the type.
For instance, I want to model the company I am working for. It has a name, a share price and a number of employees. These values change over time, but there is always exactly one company.
There are different instances of the type, each is unique.
Example: Cities. A city has a name and a population count, there are different cities and each city exists exactly once.
Each instance of the type defines multiple entities.
Example: Cars. A car has a color and a manufacturer. But there is not only one red mercedes. And even though they are similar, red mercedes #1 is different from red mercedes #2.
So lets say you are a user of this tool and you understood the concept of these three flavors. You want to create a new entity type and are prompted to choose between option 1, 2 and 3. How would you name these options?
Edit:
Documentation and help is available to the user. Also the user can be expecteted to have a technical/programming background, so understanding these three concepts should be no problem.
First of all let me make sure I understand the problem,
Here's what you have (correct me if I'm wrong):
#of instances , is/are Unique
(1,true)
(n,true)
(n,false)
If so,
for #of instances I would use single \ plural
for is\are unique (\ not unique) I would use unique \ ununique.
so you'll get:
singleUnique
pluralUnique
pluralUnunique
That's the best I could think of.. I don't know exactly who are your users and what is the environment, But if you have an option of adding tips (or documentation) that should be used for sure.