IF/ELSE IF in OLAP DML Expression
Is it possible to do an IF/ELSE IF clause directly within my DML Expression?
You maybe right. I could not find the information in the documentation where it is mentioned that the end of line character for a single line expression is '-' character.
I did see the following in OLAP DML documentation.
IF...THEN...ELSE command is documented in OLAP DML Reference Guide:
http://docs.oracle.com/cd/E11882_01/olap.112/e17122/dml_commands_2005.htm
+"When IF is used as an expression, the THEN and ELSE keywords must be on the same line as IF. When IF is used as a command, THEN and ELSE must be on separate lines."+
On webpage: http://docs.oracle.com/cd/E11882_01/olap.112/e17122/dml_expression.htm#BABGJIIJ
example 2-4 shows the following:
testprogram = IF testtype EQ 0 -
THEN 'program0' -
ELSE IF testtype EQ 1 -
THEN 'program1' -
ELSE IF testtype EQ 2 OR testtype EQ 3 -
THEN 'program2'
ELSE NA
Similar Messages
-
AWM OLAP-DML Expression to large?
Hello all!
I have a problem with my AW or with my AW -Manager. I used OLAP-DML Expressions ,and when I write longer Expressions, I got:
oracle.express.idl.util.OlapiException: java.sql.SQLException: Keine weiteren Daten aus Socket zu lesen.
So no more data from socket. I have to restart AW Manager. I can compile the Expressio nwithout error, but when I save the Expression I get the error.
I use AWM 11.2.0.3.0A
Her an example:
This function very well:
if time_utility eq 'CURRENT_DAY' then CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq '12MONTHS' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_DAY28' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 28, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_DAY7' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 7, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_MONTH' then CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'CURRENT_MONTH12' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CD7' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 7, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CD28' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 28, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CM12' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'MTD' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,1-convert(joinchars(extchars(zeit,5,2)) int),0,1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'MTD1' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,convert (ADD_MONTHS(convert( joinchars( '01' extchars(zeit,7,8)), date 'DMY'), -1) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) ,convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -1) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'MTD12' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,convert (ADD_MONTHS(convert( joinchars( '01' extchars(zeit,7,8)), date 'DMY'), -12) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) ,convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'YTD' then if extchars(zeit,1,3) eq 'DAY' then if convert(extchars(zeit,8,2), int) GE 10 AND convert(extchars(zeit,8,2), int) LE 12 THEN mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert(convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY') - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) , 0,1,zeit) ELSE mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS( convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),-12) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) , 0,1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'YTD1' then if extchars(zeit,1,3) eq 'DAY' then if convert(extchars(zeit,8,2), int) GE 10 AND convert(extchars(zeit,8,2), int) LE 12 THEN mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS (convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),-12) -convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int), convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) ELSE mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS (convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),- 2 * 12 ) -convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int), convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), - 12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION
but this is too much:
if prod_type_no eq 'PROD_TYPE_L1_Call' then ( -
if time_utility eq 'CURRENT_DAY' then CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq '12MONTHS' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_DAY28' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 28, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_DAY7' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 7, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'CURRENT_MONTH' then CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'CURRENT_MONTH12' then lag(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CD7' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 7, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CD28' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 28, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'DELTA_CM12' then LAGPCT(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, 12, zeit, RELATION ZEIT_LEVELREL) else -
if time_utility eq 'MTD' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,1-convert(joinchars(extchars(zeit,5,2)) int),0,1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'MTD1' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,convert (ADD_MONTHS(convert( joinchars( '01' extchars(zeit,7,8)), date 'DMY'), -1) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) ,convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -1) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'MTD12' then if extchars(zeit,1,3) eq 'DAY' then mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION,convert (ADD_MONTHS(convert( joinchars( '01' extchars(zeit,7,8)), date 'DMY'), -12) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) ,convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'YTD' then if extchars(zeit,1,3) eq 'DAY' then if convert(extchars(zeit,8,2), int) GE 10 AND convert(extchars(zeit,8,2), int) LE 12 THEN mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert(convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY') - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) , 0,1,zeit) ELSE mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS( convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),-12) - convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int) , 0,1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
if time_utility eq 'YTD1' then if extchars(zeit,1,3) eq 'DAY' then if convert(extchars(zeit,8,2), int) GE 10 AND convert(extchars(zeit,8,2), int) LE 12 THEN mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS (convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),-12) -convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int), convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), -12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) ELSE mvtot(CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION, convert( ADD_MONTHS (convert(joinchars( '01.10.' extchars(zeit,11,2)), date 'DMY'),- 2 * 12 ) -convert( joinchars( extchars(zeit,5,8)), date 'DMY'),int), convert(ADD_MONTHS(convert(extchars(zeit,5,8), date 'DMY'), - 12) - convert(extchars(zeit,5,8), date 'DMY'),int),1,zeit) else CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION else -
CUB_MEMBER_TRANSACTION_F_TVON / CUB_MEMBER_TRANSACTION_F_DURATION) ELSE -
+0+
Is there a limit for the length of Expressions? Or is there a problem with AW -Manager ??
Thanks a lot
Greetings from Berlin
Michael
Edited by: Schattenzeit on 13.05.2013 14:54Not sure why you are getting error.
You can put this in an OLAP dml program and call that program in your formula (i.e., calculated measure).
Some other suggestions:
(1). Define multiple formulas (or calculated measures) in your AW. For example you can define a separate calc measure for moving total function.
(2). Try to use OLAP Expression Syntax, instead of OLAP dml.
IF...THEN..ELSE logic is done using CASE statements in OLAP Expression Syntax. Moving Total and other time-series functions can be done easily also in OLAP Expression Syntax.
(3). Looks like you probably have a dimension whose members are time-series measures. You can define all the time series measures separately also. Its easier to manage each measure and you can do LOOP_VAR and LOOP_DENSE settings also for better performance. -
Creating variables in OLAP DML - 11g
Hi Experts,
My understanding is that the OLAP metadata is exposed to GUI via formulas only. if I create a variable in OLAP DML worksheet, is it possible to expose it to cube view, and awm by formulas/programs etc?
Kind RegardsIn OLAP Worksheet you can select 'SQL Mode' from the Options menu and run the SELECT statement there. Alternatively you can run the SELECT statement from inside an olap dml PROGRAM. Here is an example.
DEFINE LIST_AWS PROGRAM
PROGRAM
VARIABLE _owner TEXT
VARIABLE _aw TEXT
VARIABLE _errortext TEXT
VARIABLE _id_width INTEGER
TRAP ON HADERROR NOPRINT
" SQL Names are 30 characters long
_id_width = 30
" Declare a SQL cursor to get the list of AWs
SQL DECLARE AW_SQL CURSOR FOR -
SELECT OWNER, AW_NAME FROM ALL_AWS
" Open the cursor
SQL OPEN AW_SQL
" Loop through the results
WHILE SQLCODE EQ 0
DO
IF _aw EQ NA
THEN DO
" First loop, so print report headings
SHOW JOINCHARS(RPAD('OWNER', _id_width) ' ' 'AW')
SHOW JOINCHARS(RPAD('-' _id_width '-' ) ' ' RPAD('-' _id_width '-'))
DOEND
ELSE DO
" Print aw and owner names
SHOW JOINCHARS (RPAD(_owner, _id_width) ' ' _aw)
DOEND
" Fetch next row into local varialbes
SQL FETCH AW_SQL INTO :_owner, :_aw
DOEND
" A SQLCODE of 100 is OK,since it means end of records
IF SQLCODE EQ 100
THEN DO
SQL CLOSE AW_SQL
SQL CLEANUP
RETURN
DOEND
HADERROR:
SHOW SQLERRM
SQL CLEANUP
ENDAnd here is what I see when I call it as the GLOBAL user.
call list_aws
OWNER AW
SYS EXPRESS
SYS AWMD
SYS AWCREATE
SYS AWCREATE10G
SYS AWXML
SYS AWREPORT
GLOBAL GLOBAL -
11g - Listing Workspaces in OLAP DML
Hi All,
Is there a way in OLAP worksheet, to list all the workspaces accessible to the user?
It can be done by querying the data dictionary - "select * from all_aws;" but this information should be available in AW and OLAP DML too?
Regards, NeeleshIn OLAP Worksheet you can select 'SQL Mode' from the Options menu and run the SELECT statement there. Alternatively you can run the SELECT statement from inside an olap dml PROGRAM. Here is an example.
DEFINE LIST_AWS PROGRAM
PROGRAM
VARIABLE _owner TEXT
VARIABLE _aw TEXT
VARIABLE _errortext TEXT
VARIABLE _id_width INTEGER
TRAP ON HADERROR NOPRINT
" SQL Names are 30 characters long
_id_width = 30
" Declare a SQL cursor to get the list of AWs
SQL DECLARE AW_SQL CURSOR FOR -
SELECT OWNER, AW_NAME FROM ALL_AWS
" Open the cursor
SQL OPEN AW_SQL
" Loop through the results
WHILE SQLCODE EQ 0
DO
IF _aw EQ NA
THEN DO
" First loop, so print report headings
SHOW JOINCHARS(RPAD('OWNER', _id_width) ' ' 'AW')
SHOW JOINCHARS(RPAD('-' _id_width '-' ) ' ' RPAD('-' _id_width '-'))
DOEND
ELSE DO
" Print aw and owner names
SHOW JOINCHARS (RPAD(_owner, _id_width) ' ' _aw)
DOEND
" Fetch next row into local varialbes
SQL FETCH AW_SQL INTO :_owner, :_aw
DOEND
" A SQLCODE of 100 is OK,since it means end of records
IF SQLCODE EQ 100
THEN DO
SQL CLOSE AW_SQL
SQL CLEANUP
RETURN
DOEND
HADERROR:
SHOW SQLERRM
SQL CLEANUP
ENDAnd here is what I see when I call it as the GLOBAL user.
call list_aws
OWNER AW
SYS EXPRESS
SYS AWMD
SYS AWCREATE
SYS AWCREATE10G
SYS AWXML
SYS AWREPORT
GLOBAL GLOBAL -
How do I view data from OLAP DML program or statement?
Hi
I'm struggling to find any information on this topic anywhere on the net:
How to view data produced by an Oracle OLAP DML program or statement.
Background :
I am using the latest AWM to create and maintain dimensions, cubes and measures. However, I've noticed that AWM, Discoverer OLAP, BI Beans, Excel Plug-In et al only provide a fixed set of formula and expressions.
For example, I wanted to created a Standard Deviation (STDEV) on measure. After much searching I learnt that I could do this by creating a custom measure in AWM by importing a measure defined in an XML dcoument as it's not provided by AWM. The output in Discoverer OLAP on the surface seems to give the correct results, however when drilling from high level to lower level of time time dimension hierarchy Discoverer includes the parent value in the calculation and renders the values incorrect.
My alternative is to use OLAP DML, as it provides a richer range of formuale and calculations possibilities and I was hoping to use this functionality to do create the measures. I have the distinct impression, however, that OLAP Worksheet is the only interface out there to do this.
It seems very primitive and limited with regards to data output, almost like SQL*Plus in many ways.
The burning questions I have are :
1) Do I need to write DML programs to perform these custom measure calculations and add them to cubes or do I import the custom measures via AWM and XML?
2) If the answer to question 1 is DML programming, is there a way of viewing the OLAP data output through a GUI interface without embedding the statements in SQL.
3) Has anyone experienced or noticed the same problem with Discoverer OLAP, AWM Viewer that I mentioned above? i,e, statistical functions performed on whole dimension hierarchy rather than lower levels.
I'm hoping someone out there knows what I am trying to do or get at. Keith, any ideas or suggestions?
Thanks
Kind Regards
GregHi Greg,
There are two ways to achieve what you want. Both require the use of custom calculations which cannot be created via the calculation wizard within AWM. To do this the easiest way is step outside of AWM and use the Excel Calculation utility that is on the OLAP OTN home page:
Creating OLAP Calculations using Excel
http://download.oracle.com/otn/java/olap/SpreadsheetCalcs_10203.zip
Readme
http://www.oracle.com/technology/products/bi/olap/OLAP_SpreadsheetCalcs.html
(Oracle OLAP DML Reference contains a list of all the OLAP functions that can be used to create a custom calculation. http://www.oracle.com/technology/products/bi/olap/OLAP_DML_10.2.zip)
The Excel tool lets you assign your own formula to a measure and then uploads that measure definition into your AW. It is possible to import a custom calculation template into AWM using the menu option on the Calculated Measure node of each cube, but it is safer to use the Excel Worksheet as this directly uses the public XML API and is always best to use a public API rather than hacking XML templates.
There are two types of custom calculation:
1) Formula: using a formula you can directly call any of the OLAP functions. For example to create a measure that returns the standard deviation for a measure then you would enter the following as the formula for your calculated measure:
stddev(sales_revenue, time)
The easiest way to test if the measure is working as expected is to use the data viewer within AWM.
2) Programs - if the function you need is not provided or you want to do special processing to return a result you can create an OLAP DML program which can return a result. To do this use OLAP Worksheet to define the program and add a datatype to the DEFINE statement, such as :
DEFINE PRG_SD_SALES PROGRAM DECIMAL
In the program return the value you have calculated within your program. Within the program you can do just about anything but be aware that your program is going to fire for every cell within your virtual cube so it must be efficient and fast to execute. For a measure then you would enter the following as the formula for your calculated measure:
prg_sd_sales(time, products, geographies, channels).
The actual program code would look something like this:
DEFINE PRG_SD_REVENUE PROGRAM DECIMAL
PROGRAM
argument T_TIME TIME
argument T_PRODUCT PRODUCTS
argument T_GEOGRAPHY GEOGRAPHIES
argument T_CHANNEL CHANNELS
variable D_RETURN decimal
TEMPSTAT TIME, PRODUCTS, GEOGRAPHIES, CHANNELS
do
limit PRODUCTS to T_PRODUCT
limit CHANNELS to T_CHANNEL
limit GEOGRAPHIES to T_GEOGRAPHY
limit TIME to T_TIME
limit TIME add descendants using TIME_PARENTREL
limit TIME keep TIME_LEVELREL 'CAL_MONTH'
D_RETURN = stddev(SALES_REVENUE)
doend
return D_RETURN
END
This code computes a standard deviation the all months within the specified time range, at year level for all 12 months, at quarter level for the three months within the quarter ans returns NA at the month level.
As the code executes within a implicit loop you can only change the status fo dimensions that for part of that implicit by using the TEMPSTAT command. To test the program at the command line use the OLAP Worksheet and the SHOW command to just return one cell of data, DO NOT SIMPLY USE THE RPR COMMAND because you will have to wait for the whole cube to be returned. If you want to use the RPR command make sure you limit your base dimensions first! You can use PRGTRACE to debug your program code it is not working as expected. Again, the easiest way to test if the measure is working as expected is to use the data viewer within AWM, although this will not return debug information so send all your debug output to a file to capture any errors and/or trace the execution flow.
Hope this helps
Keith Laker
Oracle EMEA Consulting
BI Blog: http://oraclebi.blogspot.com/
DM Blog: http://oracledmt.blogspot.com/
BI on Oracle: http://www.oracle.com/bi/
BI on OTN: http://www.oracle.com/technology/products/bi/
BI Samples: http://www.oracle.com/technology/products/bi/samples/ -
Hello!
Just upgraded from 10.2.0.4 64 bit Windows to 11.2.0.2 64 bit OEL it test environment. DB Compatibility = 11.2.
SQL> select comp_name,version,status from DBA_REGISTRY where comp_name like '%OLAP%';
COMP_NAME
VERSION STATUS
OLAP Analytic Workspace
11.2.0.2.0 VALID
Oracle OLAP API
11.2.0.2.0 VALID
OLAP Catalog
11.2.0.2.0 VALID
Problem 1: We had 2 AWs in PROD on 10.2.0.4.We can not open any of them in 10g mode.
Problem 2: When we are trying to create AW in 11G mode we receive this error: XOQ-00703: error executing OLAP DML command "(SYS.AWXML!R11_INITIALIZE_AW
We have tried to rerun xumuts.plb under sys.
Log contains following errors:
=============================================
BEGIN dbms_aw_build.build('EXPRESS', FALSE); END;
ERROR at line 1:
ORA-00600: internal error code, arguments: [xspg: RSALPAGE01], [8128], [], [],
ORA-06512: at "SYS.DBMS_AW_BUILD", line 107
ORA-06512: at line 1
BEGIN dbms_aw_build.build('AWMD', TRUE); END;
ERROR at line 1:
ORA-34738: A severe problem has been detected. Analytic workspace operations
have been disabled.
ORA-06512: at "SYS.DBMS_AW_BUILD", line 107
ORA-06512: at line 1
==========================================
and so on for each system AW
should we raise a SR or somebody has any idea?
Big thx in advance!
Regards,
Kirill
Edited by: Kirill on Jun 16, 2011 1:34 PMI think you should raise an SR on this issue.
-
INI: XOQ-01600: OLAP DML Error "ORA-01438: value larger than specified prec
I have created a Time dimension in AWM 11.1.0.7.0B.
I have added two Hierarchies to it. One Hierarchy has All Years, Year, Week, day. The second hierarchy has All Years, Year, Quarter.
When I maintain the dimension, the following error occurs:
An error has occurred on the server
Error class: Express Failure
Server error descriptions:
INI: Error creating a definition manager, Generic at TxsOqConnection::generic<BuildProcess>
INI: XOQ-01600: OLAP DML Error "ORA-01438: value larger than specified precision allowed for this column
" while executing DML "SYS.AWXML!R11_LOAD_DIM('TIME.ALL_GREGORIAN_YEARS.LEVEL' SYS.AWXML!___R11_LONG_ARG_VALUE(SYS.AWXML!___R11_LONG_ARG_DIM 1) 'TIME.END_DATE.ATTRIBUTE' 'TIME.TIME_SPAN.ATTRIBUTE' 'TIME.LONG_DESCRIPTION.ATTRIBUTE' 'TIME.SHORT_DESCRIPTION.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_END_DATE.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_TIME_SPA.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_LONG_DES.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_SHORT_DE.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_TIME_SPA1.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_TIME_SPA2.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_TIME_SPA3.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_LONG_DES1.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_SHORT_DE1.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_TIME_SPA4.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_LONG_DES2.ATTRIBUTE' 'TIME.ALL_GREGORIAN_YEARS_SHORT_DE2.ATTRIBUTE' 'TIME.GREGORIAN_QUARTER_END_DATE.ATTRIBUTE' 'TIME.GREGORIAN_QUARTER_TIME_SPAN.ATTRIBUTE' 'TIME.GREGORIAN_QUAOLAP DML Error "%(1)s" while executing DML "%(2)s", Generic at TxsOqStdFormCommand::execute
at oracle.olapi.data.source.DataProvider.callGeneric(Unknown Source)
at oracle.olapi.data.source.DataProvider.callGeneric(Unknown Source)
at oracle.olapi.data.source.DataProvider.executeBuild(Unknown Source)
at oracle.olap.awm.wizard.awbuild.UBuildWizardHelper$1.construct(Unknown Source)
at oracle.olap.awm.ui.SwingWorker$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)The most likely explanation is that you have a numeric attribute whose data type precision is less than that of the column it is mapped to. For example if you had an attribute with data type NUMBER(2) and you mapped it to a column with data type NUMBER(5), then you could get this error on load. Note that some of the attributes may not be visible in AWM. The offending SQL statement should be in the OUTPUT column of the CUBE_BUILD_LOG, but you may be able to fix this by just describing the view associated with the dimension. For example, here is the description of a TIME view created in 11.2..
Name Null? Type
DIM_KEY VARCHAR2(60)
LEVEL_NAME VARCHAR2(30)
MEMBER_TYPE VARCHAR2(1)
DIM_ORDER NUMBER
END_DATE DATE
TIME_SPAN NUMBER
LONG_DESCRIPTION VARCHAR2(60 CHAR)
SHORT_DESCRIPTION VARCHAR2(60 CHAR)
MONTH_END_DATE DATE
MONTH_TIME_SPAN NUMBER(5)
MONTH_LONG_DESCRIPTION VARCHAR2(60 CHAR)
MONTH_SHORT_DESCRIPTION VARCHAR2(60 CHAR)
FISCAL_QUARTER_END_DATE DATE
FISCAL_QUARTER_TIME_SPAN NUMBER(5)
FISCAL_QUARTER_LONG_DESC VARCHAR2(60 CHAR)
FISCAL_QUARTER_SHORT_DES VARCHAR2(60 CHAR)
FISCAL_YEAR_END_DATE DATE
FISCAL_YEAR_TIME_SPAN NUMBER(5)
FISCAL_YEAR_LONG_DESCRIP VARCHAR2(60 CHAR)
FISCAL_YEAR_SHORT_DESCRI VARCHAR2(60 CHAR)
CALENDAR_QUARTER_END_DAT DATE
CALENDAR_QUARTER_TIME_SP NUMBER(5)
CALENDAR_QUARTER_LONG_DE VARCHAR2(60 CHAR)
CALENDAR_QUARTER_SHORT_D VARCHAR2(60 CHAR)
CALENDAR_YEAR_END_DATE DATE
CALENDAR_YEAR_TIME_SPAN NUMBER(5)
CALENDAR_YEAR_LONG_DESCR VARCHAR2(60 CHAR)
CALENDAR_YEAR_SHORT_DESC VARCHAR2(60 CHAR)You can get the same information from user_cube_attributes
SQL> select attribute_name, data_precision from user_cube_attributes where dimension_name = 'TIME' and data_type = 'NUMBER';
ATTRIBUTE_NAME DATA_PRECISION
TIME_SPAN
MONTH_TIME_SPAN 5
FISCAL_QUARTER_TIME_SPAN 5
FISCAL_YEAR_TIME_SPAN 5
CALENDAR_QUARTER_TIME_SPAN 5
CALENDAR_YEAR_TIME_SPAN 5 -
Help on OLAP DML function – "joinchars"
Hi,
We have built a cube called 'CubeTest' which has a measure called 'TestMeasure' of decimal data type, using Oracle AWM v10.2.0.3.0A.
Now, I am using "Oracle OLAP Calculations v1.2.5", as available on OTN homepage, to define my own calculated measures using OLAP DML for this cube.
I have defined the following two measures (for both, Calculation Type is 'Equation' and both are using free-form equations defined over TestMeasure):
1. Calculated_Measure1
2. Calculated_Measure2
Now, I want to define a third calculated measure in a way that it represents a concatenation of the above two measures suffixed with some standard text.
e.g. A Typical value of the third calculated measure will be like:
Calculated_Measure1 + 'ABC' + Calculated_Measure2 + 'XYZ'
Here, the '+' sign indicates the idea of concatenation.
To achieve the above result, I am using the OLAP DML function "joinchars" to define a free-form equation like the one below:
joinchars(Calculated_Measure1,'ABC',Calculated_Measure2,'XYZ')
Now, the issue is that calculation like the one above, using joinchars is not being created successfully. I tried pre-qualifying (and not pre-qualifying) the names of the calculated measures with the cube name and also experimenting with the “Show” command. Also, once the calculation definition fails to get created, I am not even being able to attach my AW in R/W mode as I get the error as below:
oracle.AWXML.AWException: java.lang.NullPointerExceptionat oracle.AWXML.AW.readAWDefinitions(AW.java:1339)at oracle.olap.awm.dataobject.aw.WorkspaceDO.getModelAW(WorkspaceDO.java:803)at oracle.olap.awm.dataobject.aw.WorkspaceDO.getModelAW(WorkspaceDO.java:749)at oracle.olap.awm.navigator.node.WorkspaceNode.getModelerViewChildren(WorkspaceNode.java:368)at oracle.olap.awm.navigator.node.WorkspaceNode.getChildren(WorkspaceNode.java:341)at oracle.olap.awm.navigator.node.BaseNodeModel.refreshData(BaseNodeModel.java:74)at oracle.olap.awm.navigator.node.BaseNodeModel.dTreeItemExpanding(BaseNodeModel.java:221)at oracle.bali.ewt.dTree.DTreeDeferredParent.__fireExpansionChanging(Unknown Source)at oracle.bali.ewt.dTree.DTreeDeferredParent.setExpanded(Unknown Source)at oracle.olap.awm.navigator.node.BaseNode.expandHelper(BaseNode.java:2186)at oracle.olap.awm.navigator.node.BaseNode.access$400(BaseNode.java:109)at oracle.olap.awm.navigator.node.BaseNode$ExpansionThread.run(BaseNode.java:2136)Caused by: java.lang.NullPointerExceptionat oracle.AWXML.AW.readAWDefinitions(AW.java:1313)... 11 more
For the above issue, I have the following questions to seek your help on:
1. First, obviously, to know what is wrong with the usage of "joinchars" in this scenario.
2. If we use Oracle OLAP Calculations v1.2.5 to define any calculations, and if for some reason, the calculation is not defined successfully, is there any way to see what went wrong and where (this is because if your calculation definition fails, the Oracle OLAP Calculations v1.2.5 utility just exits out without giving any significant information on the reason for failures).
3. When we create any new calculation and then click on “Define Calculations” button, the Oracle OLAP Calculations v1.2.5 utility prompts us with the message “Do you want to update the AW views after creating the calculation (Y/N)? – Can you please help me with the details on the implications of stating a Y or N to this message.
Any help on these questions is much appreciated.
Thanks and Regards,
PiyushPiyush..
The Error you get on using the rpr command is a display error, its not a functionality issue. Think of this as something similar to the sqlplus buffer overflow issue if you have a pl/sql program which outputs a lot of dbms_output.put_line statements.
So if you get a display error, restrict the cube or the dimensions to a reasonable number and check your output. Example: Take every user dimension and restrict them to a few values... (say, 5 products, 1 channel, 1 location, 1 organization, 2 time periods)..
Rpr <<expression>>
will return the expression for every cell in status.. Depending on the dimensions that the expression is based on, for every dimension depending on the number of values (members) in status, the <<expression>> is evaluated and output'ed.
No of cells in report is Cross product of each dimensions status (statlength).. For example above.. 5*1*1*1*2 = 10 cells.
Shw <<expression>>
will return the expression for the first cell in status.. 1st value (member) in status for every dimension that <<expression>> depends on.
Hence Shw <<expressions>> does not lead to a display error since the output is restricted (small).
Using the OLAP Calc utility to define the formula (the utility uses java olap apis), you may need to do something to protect the single quotes so that the expression gets evaluated with single quotes in the OLAP DML formula.
You can try...
joinchars(CUBE1_CMEAS1, \'ABC\', CUBE1_CMEAS2, \'XYZ\')
If above doesn't work, just ask for help regd how to translate a formula expression containing single quotes (formula is correct in OLAP DML) into the AW via the Spreadheet utility.
HTH
Shankar -
hi all,
I am trying to do the tutorial Building OLAP 11g Cubes (http://st-curriculum.oracle.com/obe/db/11g/r1/olap/cube/buildicubes.htm), but when I try to "Maintain Cube SALES_CUBE" I get the following error:
An error has occurred on the server
Error class: Express Failure
Server error descriptions:
INI: error creating a definition manager, Generic at TxsOqConnection::generic<BuildProcess>
INI: ORA-35571: The maximum number of load errors has occurred. No changes from this step were committed to the database.
XOQ-01600: OLAP DML error while executing DML "SYS.AWXML!R11_LOAD_DIM", Generic at TxsOqStdFormCommand::execute
INI: XOQ-01601: error while loading data for Cube Dimension "OLAPTRAIN.PRODUCT" into the analytic workspace, Generic at TxsOqStdFormCommand::callR11LoadDim
at oracle.olapi.data.source.DataProvider.callGeneric(Unknown Source)
at oracle.olapi.data.source.DataProvider.callGeneric(Unknown Source)
at oracle.olapi.data.source.DataProvider.executeBuild(Unknown Source)
at oracle.olap.awm.wizard.awbuild.UBuildWizardHelper$2.construct(Unknown Source)
at oracle.olap.awm.ui.SwingWorker$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
Can anyone help me?
Thanks,
CarlosI have seen this (in 11.1.0.7, I believe) when the metadata cache ("kgl") gets out of synch with the data dictionary. Specifically there is a flag that determines if prefixes get added to dimension members ("use surrogates" in AWM terms) that becomes false instead of true. If you look at the generated SQL in the OUTPUT column of the CUBE_BUILD_LOG you may find that sometimes a prefix is added to dimension members (e.g. "LEAF_LEVEL_" || dim_table.leaf_column) and othertimes it is not (e.g. just dim_table.leaf_column). A workaround if this is the case may be to execute the following (as dba) before building the dimension.
alter system flush shared_pool; -
XOQ-01600: OLAP DML error "ORA-33858: 11g Cube
Hi All ,
I was trying to apply the cube changes after changing the sparsity definition against one of the dimension under Storage tab and it is throwing below error .
Any reason ?
An error has occurred on the server
Error class: Express Failure
Server error descriptions:
DPR: cannot create server cursor, Generic at TxsOqDefinitionManager::generic<CommitRoot>
INI: XOQ-01600: OLAP DML error "ORA-33858: The value of the ampersand-substitution expression is NA." while executing DML "SYS.AWXML!R11_MANAGE_CUBE('MARKET_SALES_CUBE_WORKING.CUBE' 'ALTER' 'NUMBER' SYS.AWXML!___R11_LONG_ARG_VALUE(SYS.AWXML!___R11_LONG_ARG_DIM 1) SYS.AWXML!___R11_LONG_ARG_VALUE(SYS.AWXML!___R11_LONG_ARG_DIM 2) 'TIME.DIMENSION' 'TIME.CALENDER.HIERARCHY' 'TIME.MONTHLY.LEVEL' 'COMPRESSED' 'YES' 'YES' 'MARKET_SALES_CUBE_WORKING.SOLVE.AGGREGATIONDEFINITION' 'NO')", Generic at TxsOqStdFormCommand::execute
Thanks in advance,
DxPI have seen this kind of error show up if you rename an object (e.g. a measure) and then make further modifications. Did that happen in your case? If you export the cube to XML, delete it from AWM, and then recreate it from XML, then it may resolve the problem. If not, and if it is preventing your from making progress, then I would open a service request since we usually need to enable tracing to resolve this class of error.
-
OLAP DML program 10g Help!!
I have a OLAP DML program that I am invoking as follows
call pmtdim_user_sec(_aw 'MG_OU' 'OPERATING_UNIT')
The intent is to use the OPERATING_UNIT or parameter in 3rd place as a condition for cursor in the program.
e.g. below for the sql for cursor.
select PF_OBJ_ID from ps_cgf_ac_security@act_link -
where OPRID =USER and PF_OBJECT_TYPE = 'OPERATING_UNIT'
However when I use it in the program as below I get a failure during opening of cursor. The same thing when hardcoded per this SQL works fine? Am I doing anything incorrect. I tried using objtype and objecttype variables below in the where condition without any luck.
Program below:
" pmtdim_user_sec -PROGRAMS
arg _aw text "fully qualified AW name e.g. AWADMFDL.FDL
arg dimname text "Dimension ID on which PERMITREAD needs to be set
arg _objtype text "Object type for row level security
vrb _dim1 text
vrb _dimlist text
vrb _used text
vrb _usedlist text
vrb _finallist text
vrb _uservalue text
vrb _userlist text
vrb _objecttype text
show 'beginning of the program'
show _dimname
show _objtype
trap on failure
badline = y
"multi aw and object fetching
_dim1 = joinchars(_aw '!' _dimname)
_used = joinchars(_aw '!' _dimname '_USED_IS_IT')
_objecttype = joinchars('\'' _objtype '\'')
show ' objecttype :'
show _objecttype
show 'before cursors'
sql declare c2 cursor for -
select PF_OBJ_ID from ps_cgf_ac_security@act_link -
where OPRID =USER and PF_OBJECT_TYPE = _objecttype
push &_dim1
"Initializing
_dimlist = na
_usedlist = na
_finallist = na
_userlist = na
show 'before opening of cursor'
sql open c2
show 'opening cursor'
if sqlcode ne 0
then goto failure
show 'before while'
while sqlcode eq 0
do
show 'before fetch'
sql fetch c2 into :_uservalue
show 'after fetch'
if exists (_uservalue)
then
if isvalue(&_dim1 joinchars(_uservalue))
then dimlist = joinlines(dimlist _uservalue)
else goto failure
doend "while
sql close c2
show 'end of opening of a cursor'
_finallist = joinlines(_dimlist)
_finallist = uniquelines(_finallist)
show 'Final List '
show _finallist
if _finallist ne na
then do
lmt &_dim1 to _finallist
&joinchars('lmt ' _dim1 ' add descendants using ' _dim1 '_parentrel')
"&joinchars('lmt ' dim1 ' add ancestors using ' dim1 '_parentrel')
&joinchars('consider ' _dim1)
&joinchars('permit read when instat('_dim1 ' ' _dim1 ')')
doend
pop &_dim1
return
failure:
pop &_dim1
signal errorname errortext
return errortextIs it the usage of the host variable syntax within the sql define cursor statement which did the trick ... ":_objecttype" instead of "_objecttype".
I've used the following syntax in olap dml programs in 10gR2 (only 1 filter in the sql statement though)...
"where pr.user_id = :_appuser" ... _appuser is a text variable (not argument) defined locally in the program. -
Equivalent to ROLAP :insert, update, delete in OLAP DML?
I have a ROLAP star schema. The process update is in Real Time using triggers in the operational tables. When an update in the operational table occur the trigger call a store procedure where : 1- find de fact row using dimensions key, 2-the messure value is update.
Question:? How to do the same in MOLAP 11g . What are the OLAP DML commands to use?
Thank'sin these case what about data duplication? :
1- the production db
2- the star schema
3- the molap cube
i have 12 fact tables with millions of records.
my abstract scenario view:
production table:
pk field1 field2 field3
1 A B Z
2 A B Y
3 A B X
4 A B Z
5 A C Z
6 A C Z
7 E B Z
8 E C Y
star schema:
dim_field1 table:
pk field1
1 A
2 E
dim_field2 table:
pk field2
1 B
2 C
fact table:
pk id_field1 id_ field2 count
1 1 1 4
2 1 2 2
3 2 1 1
4 2 2 1
my abstract real time update process:
case a) change in the 4 row production table: from field2 value (B) to field2 value(C)
step 1: search in the fact table with id_field1 value (1) and id_field2 value (1).. row 1
step 2: count=count-1= 4-1 ( if result count=0 then delete these row 1 )
step 3: search in the fact table with id_field1 value(1) and id_field2 value(2) ...row 2
step 4: if that combination exists
then count=count+1
else insert a new fact row with count=1 and id_field1 value(1) and id_field2 value(2)
is possible to do that with OLAP DML , please a need an example about how to do?
Thanks -
OLAP DML Error : -35188 : ORA-35188: The word = must be followed by an expr
Hi ,
While doing OLAP DML I am getting following error
-35188 : ORA-35188: The word = must be followed by an expression.When searched Error list I could not any helpful explanation for this error.
Any clue about this error?
JosephHi,
I found the issue , a value for measure was pushed and that time this error was happening,Reason was
the value passed was .01 , but since the Number format was ',' for a decimal point value passed was ,01
Turning the Number format to '.' for decimal points resolved the issue. -
Hi
Can anyone suggest a good book for gettig to grips with OLAP DML?
Thanks
MelanieAs Anthony said, probably the best guides you'll get to the OLAP DML are the online documentation - which also have the benefit of being free! In all honesty, the online docs are about the best & most comprehensive guide to OLAP DML, and these should be your primary source of detailed information on 9i OLAP and OLAP DML.
If you want to buy a book, there aren't any (as far as I'm aware) that are exclusively about OLAP DML (or the old Express 4GL, which is more or less the same), but a couple that might be of interest to you are;
- Oracle9iR2 Data Warehousing by Lillian Hobbs http://www.amazon.com/exec/obidos/ASIN/1555582877
This covers all the 9iR2 BI&W tools, and has a chapter on the OLAP Option and OLAP DML
- Oracle Express OLAP by Sergei Arkhipentov http://www.amazon.com/exec/obidos/ASIN/1584500840/
Not just about Express (it also covers Disco, OWB etc) but has several chapters on Express 4GL
hope this helps
Mark -
OLAP DML: How to specify multidimensional QDR(qualified data ref) for Model
Hello,
I'm discovering Oracle OLAP DML and having a hard time understanding how to formulate multidimensional expressions in models.
In a setting with a solution variable (eg. result), I can do:
LIMIT account TO sales.internal
result = result(account '3xxx', consolidation 'internal')
but what to do within a model?
DIMENSION account consolidation
sales.internal = ??? (QDR to limit account to '3xxx' and consolidation to 'internal')
No examples in the OLAP DML doc use multidimensional QDRs in models, and I get a syntax error trying with (account '3xxx', consolidation 'internal').
Any suggestions?
Regards, Hans HenrikIt should look something like this :
MODEL
result(account 'sales.internal') = result(account '3xxx' consolidation 'internal')
END
No dimension statement is needed for variable equation.
Maybe you are looking for
-
Hi, we're working on a social community that requires us to play back multiple videos in a Flash app. Is there any way of compiling the finite output of a Flash application (that plays back a collection of movies + effects) into a video file? Any for
-
Sort order in iPad's Remote app
I have a few smart playlists in iTunes. When I control iTunes from my iPad's Remote app, some playlists show up (correctly) ordered by Album, other smart playlists are ordered by song. In iTunes (on my MacPro), though, both are ordered by album. Is t
-
Troubleshooting BACKUPTHREAD wait type
SELECT r.wait_type command, s.text, start_time, percent_complete, CAST(((DATEDIFF(s,start_time,GetDate()))/3600) as varchar) + ' hour(s), ' + CAST((DATEDIFF(s,start_time,GetDate())%3600)/60 as varchar) + 'min, ' + CAST((DATEDIFF(s,start_time,GetDate(
-
Get Counts Fails in Siebel Analytics 7.8 Segmentation Manager
Get Count function in Segmentation Manager fails with bellow error : "GetCount" failed.Assertion failure: nTasks <= MAXIMUM_WAIT_OBJECTS at line 65 of ./project/webthreads/windows/winfuturetask.cppSET VARIABLE Where do I increse the value for "MAXIMU
-
I moved CS3 to my new pc and now when I click on BRIDGE it doesn't respond?