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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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