BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I would like to use PROC OLAP to create a calculated measure so that when I re-create the cube it is there and ready to go. It is a simple ratio of 2 other sum measures that I am calculating already. I tried using the DEFINE statement, but got the following error message...

ERROR: None of the global definitions in the DEFINE statement(s) could be verified as syntactically correct, or none of the global
definitions could be registered with the metadata server.

Maybe I need to try a different approach?
4 REPLIES 4
AngelaHall
SAS Employee
The DEFINE statement should work. Can you post an example of your current syntax for us to review?

Here is an example of another ratio (built off of a prior DEFINE sum):

DEFINE MEMBER '[CUBE_NAME].[Measures].[Total_Measure_Name]' AS
'sum(YTD([DIM_NAME].[HIER_NAME].LastChild),[Measures].[Measure_Name]),format_string="DOLLAR20."'
;

DEFINE MEMBER '[CUBE_NAME].[Measures].[Ratio_Measure_Name]' AS
'[Measures].[Total_Measure_Name] / [Measures].[Denominator_Measure_Name],format_string="PERCENT10.2"'
;

~ Angela Hall
http://sas-bi.blogspot.com
deleted_user
Not applicable
Here is the DEFINE statement I used:

define member '[SMB_TOTMKT].[Measures].[mkt_share]'
as '[Measures].[locations]/[Measures].[vendor_nums]';

This looks similar to your 2nd example, only without the format string.
AngelaHall
SAS Employee
When you run the proc olap full code - do you have a prior step to delete the entire OLAP cube - or just the delete_physical?
(it needs to be 'delete' since you are adding metadata)
Use my post: http://sas-bi.blogspot.com/2005/08/refreshing-olap-cubes.html as an example (just change 'delete_physical' to 'delete').

Does the user that is running the proc OLAP step have 'write metadata' and 'delete' access to the OLAP schema?

~ Angela Hall
http://sas-bi.blogspot.com
deleted_user
Not applicable
Yes I have a step to delete the cube prior to running PROC OLAP to create the new cube. This delete step is done using a macro call, delete_cube_reg(CubeName) which in turn executes PROC OLAP cube=&CubeName DELETE;

The userid I am using is a common one that I believe has all of the necessary access priveleges since I am able to create and delete cubes using this userid.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 898 views
  • 0 likes
  • 2 in conversation