Can we calculate difference of dimension properties values in script logic
HI
I have 3 products, whose manufacturing process starting perod and end periods are different for three products. Now I want
to distribute total manufactuing cost to those periods only for each product. how will write script logic for this senario.
My system is BPC nw7.5
Mahi
Hi,
So, you want to find the difference between the dates and distribute the cost among them. I dont think this will be feasible using script logic. My suggestion would be use BADI. Script logic cannot do manipulation on the properties. BADI will be much easier. In addition to this, you need to think what should be the destination of the result. Every record is going to generate few records (depending on the number of months).
Hope this helps.
Similar Messages
-
Proper formatting for dimension properties in SQL script logic
Hi all,
I'm trying to pass the time member from a property in account dimension. (Post recognized revenue by looking at deferred revenue accounts.) The dimension ACCTREV has a property called DATENAME. DATENAME refers to a valid TIME member. In 4.2 this logic worked fine. In 5.1sp3 it's not passing the correct time period (formula log indicates null value for time member).
For example: ACCTREV = 4101Billing_2008.JUN DATENAME = 2008.JUN (DATENAME is a property of ACCTREV)
Here's the logic: *REC(EXPRESSION=%VALUE%,TIME=ACCTREV.DATENAME,ACCTREV=ACCTREV.ACCT)
I've read the other post indicating brackets are required by SQL when passing parameters that contain delimiters like "." but it doesn't say how to do it!
I've tried TIME=ACCTREV.DATENAME resulting in null time members.
I've tried TIME=ACCTREV.DATENAME resulting in null time members.
I've updated the property value to 2008.JUN with TIME=ACCTREV.DATENAME resulting in null time members.
Also how do you post a thread using a bracket without turning it into a hyperlink?
Any help would be greatly appreciated.
Edited by: Ara Toroyan on Aug 5, 2008 2:24 AMThanks Kranthi,
It's still not working.
I believe the problem is SQL 2005 related and the DATENAME "2008.JUN."
ACCT is a property of ACCTREV and the properties refer to valid ACCTREV members.
DATENAME is a property of ACCTREV and refers to valid TIME members-- not TimeID or UserTimeID
The formula log reveals the correct ACCTs but no TIME (null values). The problem is with DATENAME. Closer inspection of the formula log below shows that Query1 doesn't load DATENAME. (Not sure why but this could be because of improper formatting.)
I've validated the existence of all property values with =EVPRO. The values are part of the dimension tables.
Here's the forumula log: (I've deleted some of the product and time members in the log for brevity.)
Number of logic calls:1
Call no. 1, logic:D:\BPC\Data\WebFolders\SecondTry\REVENUE
..\AdminApp\REVENUE\RevRec.LGX
Building sub-query 1
Query Type:0
Max members:
Region:
DIMENSION:ACCTREV
4101BILLING_2008.JUN,4201BILLING_2008.JUN,4206BILLING_2008.JUN,4207BILLING_2008.JUN,4208BILLING_2008.JUN
DIMENSION:CATEGORY
ACTUAL
DIMENSION:PRODUCT
0000,0001,0005,0010,0011,0012,0013,0020,0024,0030,0031,0040,0050,0059,0065,0066,0067,0070,0071,0075,0078,0079,0080,0099,0140,0145
DIMENSION:REVDATA
REV_AMOUNT
DIMENSION:TIME
2001.JAN,2001.FEB,2001.MAR,2001.APR,2001.MAY,2001.JUN,2001.JUL,2001.AUG,2001.SEP,2001.OCT,2001.NOV,2001.DEC,2002.JAN,2002.FEB,2002.MAR,2002.APR,2002.MAY,2002.JUN,2002.JUL,2002.AUG,2002.SEP,2002.OCT,2002.NOV,2002.DEC,2003.JAN,2003.FEB,2003.MAR,2003.APR,2003.MAY,2003.JUN,2003.JUL,2003.AUG,2003.SEP,2003.OCT,2003.NOV,2003.DEC,2004.JAN,2004.FEB,2004.MAR,2004.APR,2004.MAY,2004.JUN,2004.JUL,2004.AUG,2004.SEP,2004.OCT,2004.NOV,2004.DEC,2005.JAN,2005.FEB,2005.MAR,2005.APR,2005.MAY,2005.JUN,2005.JUL,2005.AUG,2005.SEP,2005.OCT,2005.NOV,2005.DEC,2006.JAN,2006.FEB,2006.MAR,2006.APR,2006.MAY,2006.JUN,2006.JUL,2006.AUG,2006.SEP,2006.OCT,2006.NOV,2006.DEC,2007.JAN,2007.FEB,2007.MAR,2007.APR,2007.MAY,2007.JUN,2007.JUL,2007.AUG,2007.SEP,2007.OCT,2007.NOV,2007.DEC,2008.JAN,2008.FEB,2008.MAR,2008.APR,2008.MAY,2008.JUN,2008.JUL,2008.AUG,2008.SEP,2008.OCT,2008.NOV,2008.DEC,2009.JAN,2009.FEB,2009.MAR,2009.APR,2009.MAY,2009.JUN,2009.JUL,2009.AUG,2009.SEP,2009.OCT,2009.NOV,2009.DEC
Loading ACCTREV.DATEID,ACCT
Loading TIME.TIMEID
Time to load properties:0.0 sec.
select ACCTREV,PRODUCT,TIMEID,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA
into #tblTempLogic_349866
from tblFactREVENUE
WHERE ACCTREV in (N'4101BILLING_2008.JUN',N'4201BILLING_2008.JUN',N'4206BILLING_2008.JUN',N'4207BILLING_2008.JUN',N'4208BILLING_2008.JUN') AND CATEGORY=N'ACTUAL' AND PRODUCT in (N'0000',N'0001',N'0005',N'0010',N'0011',N'0012',N'0013',N'0020',N'0024',N'0030',N'0031',N'0040',N'0050',N'0059',N'0065',N'0066',N'0067',N'0070',N'0071',N'0075',N'0078',N'0079',N'0080',N'0099',N'0140',N'0145',N'0154',N'0155',N'0156',N'0157',N'0161',N'0162',N'0163',N'0164',N'0165',N'0171',N'0175') AND TIMEID in (N'20010100',N'20010200',N'20010300',N'20010400',N'20010500',N'20010600',N'20010700',N'20010800',N'20010900',N'20011000',N'20011100',N'20011200',N'20020100',N'20020200',N'20020300',N'20020400',N'20020500',N'20020600',N'20020700',N'20020800',N'20020900',N'20021000',N'20021100',N'20021200',N'20030100',N'20030200',N'20030300',N'20030400',N'20030500',N'20030600',N'20030700',N'20030800',N'20030900',N'20031000',N'20031100',N'20031200',N'20040100',N'20040200',N'20040300',N'20040400',N'20040500',N'20040600',N'20040700',N'20040800',N'20040900',N'20041000') AND REVDATA=N'REV_AMOUNT'
insert into #tblTempLogic_349866 (ACCTREV,PRODUCT,TIMEID,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA)
select ACCTREV,PRODUCT,TIMEID,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA
from tblFactWBREVENUE
WHERE ACCTREV in (N'4101BILLING_2008.JUN',N'4201BILLING_2008.JUN',N'4206BILLING_2008.JUN',N'4207BILLING_2008.JUN',N'4208BILLING_2008.JUN') AND CATEGORY=N'ACTUAL' AND PRODUCT in (N'0000',N'0001',N'0005',N'0010',N'0011',N'0012',N'0013',N'0020',N'0024',N'0030',N'0031',N'0040',N'0050',N'0059',N'0065',N'0066',N'0067',N'0070',N'0071',N'0075',N'0078',N'0079',N'0080',N'0099',N'0140',N'0145',N'0154',N'0155',N'0156',N'0157',N'0161',N'0162',N'0163',N'0164',N'0165',N'0171',N'0175',N'0181',N'0182',N'0183',N'0185',N'0190',N'0200',N'0201',N'0210',N'0251',N'0275',N'0302',N'0305',N'0310',N'0802',N'1000',N'1002',N'1012',N'1016',N'1017',N'1026',N'1030',N'1033',N'1035',N'1041',N'1042',N'1054',N'1055',N'1059',N'1061',N'1062',N'1063',N'1065',N'1069',N'1073',N'1080',N'1082',N'1093',N'1100',N'1111',N'1120',N'1172',N'1210',N'1300',N'1700',N'1701',N'1800',N'1900',N'2082',N'2092',N'2110',N'2115',N'2118',N'2120',N'2121',N'2123',N'2124',N'2126',N'2136',N'2140',N'2150',N'2160',N'2170',N'2200',N'2201',N'2220',N'2225',N'2300',N'2500',N'2600',N'2611',N'2700',N'2701',N'2712',N'2715') AND TIMEID in (N'20010100',N'20010200',N'20010300',N'20010400',N'20010500',N'20010600',N'20010700',N'20010800',N'20010900',N'20011000',N'20011100',N'20011200',N'20020100',N'20020200',N'20020300',N'20020400',N'20020500',N'20020600',N'20020700',N'20020800',N'20020900',N'20021000',N'20021100',N'20021200',N'20030100',N'20030200',N'20030300',N'20030400',N'20030500',N'20030600',N'20030700',N'20030800',N'20030900',N'20031000',N'20031100',N'20031200',N'20040100',N'20040200',N'20040300',N'20040400',N'20040500',N'20040600',N'20040700',N'20040800',N'20040900',N'20041000',N'20041100',N'20041200',N'20050100',N'20050200',N'20050300',N'20050400',N'20050500',N'20050600',N'20050700',N'20050800',N'20050900',N'20051000',N'20051100',N'20051200',N'20060100',) AND REVDATA=N'REV_AMOUNT'
and SOURCE = 0
insert into #tblTempLogic_349866 (ACCTREV,PRODUCT,TIMEID,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA)
select ACCTREV,PRODUCT,TIMEID,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA
from tblFAC2REVENUE
WHERE ACCTREV in (N'4101BILLING_2008.JUN',N'4201BILLING_2008.JUN',N'4206BILLING_2008.JUN',N'4207BILLING_2008.JUN',N'4208BILLING_2008.JUN') AND CATEGORY=N'ACTUAL' AND PRODUCT in (N'0000',N'0001',N'0005',N'0010',N'0011',N'0012',N'0013',N'0020',N'0024',N'0030',N'0031',N'0040',N'0050',N'0059',N'0065',N'0066',N'0067',N'0070',N'0071',N'0075',N'0078',N'0079',N'0080',N'0099',N'0140',N'0145',N'0154',N'0155',N'0156',N'0157',N'0161',N'0162',N'0163',N'0164',N'0165',N'0171',N'0175',N'0181',N'0182',N'0183',N'0185',N'0190',N'0200',N'0201',N'0210',N'0251',N'0275',N'0302',N'0305',N'0310',N'0802',N'1000',N'1002',N'1012',N'1016',N'1017',N'1026',N'1030',N'1033',N'1035',N'1041',N'1042',N'1054',N'1055',N'1059',N'1061',N'1062',N'1063',N'1065',N'1069',N'1073',N'1080',N'1082',N'1093') AND TIMEID in (N'20010100',N'20010200',N'20010300',N'20010400',N'20010500',N'20010600',N'20010700',N'20010800',N'20010900',N'20011000',N'20011100',N'20011200',N'20020100',N'20020200',N'20020300',N'20020400',N'20020500',N'20020600',N'20020700',N'20020800',N'20020900',N'20021000',N'20021100',N'20021200',N'20030100',N'20030200',N'20030300',N'20030400',N'20030500',N'20030600',N'20030700',N'20030800',N'20030900',N'20031000',N'20031100',N'20031200',N'20040100',N'20040200',N'20040300',N'20040400',N'20040500',N'20040600',N'20040700',N'20040800',N'20040900',N'20041000',N'20041100',N'20041200',N'20050100',N'20050200',N'20050300',N'20050400',N'20050500',N'20050600',N'20050700',N'20050800',N'20050900',N'20051000',N'20051100',N'20051200',N'20060100') AND REVDATA=N'REV_AMOUNT'
select tmpTable.ACCTREV,tmpTable.PRODUCT,tmpTable.TIMEID,tmpTable.COMPANY,tmpTable.CUSTOMER,tmpTable.DATASRC,tmpTable.LOCATION,tmpTable.MEDIAID,tmpTable.PRODTYPE,tmpTable.TRANSID,sum(SIGNEDDATA) as SIGNEDDATA
from #tblTempLogic_349866 as tmpTable
group by tmpTable.ACCTREV,tmpTable.PRODUCT,tmpTable.TIMEID,tmpTable.COMPANY,tmpTable.CUSTOMER,tmpTable.DATASRC,tmpTable.LOCATION,tmpTable.MEDIAID,tmpTable.PRODTYPE,tmpTable.TRANSID
drop table #tblTempLogic_349866
Time to load Source data:2.6 sec.
29123 records to process
Time to Prepare data process:0.0 sec.
Time to initialize destination:0.0 sec.
Time to get source data:0.0 sec.
29123 scanned records
0 skipped records
29123 processed records
29123 records generated
Time to Scan data:5.5 sec.
Time to get output data:0.1 sec.
Time to prepare final strings:0.3
Total processing time:5.9
App: REVENUE - Records to be posted are 29119 (calc diff = 0)
CATEGORY,REVDATA,ACCTREV,PRODUCT,TIME,COMPANY,CUSTOMER,DATASRC,LOCATION,MEDIAID,PRODTYPE,TRANSID,SIGNEDDATA
ACTUAL,REV_AMOUNT,4101,0001,,03,2282436,INPUT,00,ZZ,NONE,MANUAL_TRANSBASED,-208.5
ACTUAL,REV_AMOUNT,4101,0010,,03,1000105,INPUT,00,20,CURR,TRANSACTION_BASED,-88
ACTUAL,REV_AMOUNT,4101,0010,,03,1000105,INPUT,00,20,HIST,TRANSACTION_BASED,-60 -
Fetching property value in script logic!!
Hello Experts,
We are using BPC 7.5 M, I am working on a script logic and need to fetch a value of a property of a dimension member where dimension member is itself defined in some property.
We have a Org dimension which has a property "FORECAST_UNIT" and this property contains a member Id of Org dimension itself, In my script logic I need to fetch value of "Currency" property for the Org dimension member defined in "FORECAST_UNIT" property.
Please Advice.
Thanks & Regards,
RohitHi Roberto,
Attached code (In Image) is of our Aggregate Forecast Unit logic, Every Org (Entity) has an forecasting unit defined in Forecasting unit property in Org dimension and Forecasting unit is also a member of Org dimension, below logic aggregates the data at Forecasting unit level:
The issue is that I need to check before the code marked in Red executes that if Org-- Forecasting unit -- Currency is USD then only Red part of logic should execute.
Thanks & Regards,
Rohit -
Incorrect value with Script Logic
Hello,
From initial value called 2008.ORC we want to calculate for each month the percentage , from child DIASMES.
Now, with the script logic ( I´ll put down later) we have an incorrect value in the column 2008.TOTAL.
In other words, I´m sure I´m wrong with "WHAT" or "WHERE sentence or maybe the operation "FACTOR=USING/TOTAL" fails because the crossing between dimensions it´s incorrect.
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM FABRICA_MAQ WHAT=BAS(FABRICAFF); WHERE=BAS(FABRICAFF); USING=BAS(FABRICAFF);
*DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP;
*DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL);
*DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST;
*DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES;
*DIM DATASRC WHAT=INPUT; WHERE=INPUT; USING=INPUT;
*DIM VERSAO WHAT=BUDGET; WHERE=BUDGET; USING=BUDGET;
*ENDALLOCATION
*COMMIT
The Key is to see in the column 2008.TOTAL ( when we selected "BAS") the value of parent divided into "DIASMES" !
Thanks !!Your factor statment references a TOTAL, but you don't reference the total in your DIM statements. If you look at the debug log carefully, you should notice that there's no calculation of a TOTAL value.
Try something like this. The only reason I move some dimensions from the *RUNALLOCATION up to the *XDIM's is for legibility, since the allocation makes no shifts to these dimensions. The logic should produce the same results, either way.
// These dimensions have no shift of data.
*XDIM_MEMBER VERSAO=BUDGET
*XDIM_MEMBER DATASRC=INPUT
// I'm assuming here that FACRICAFF is the top member of this dimension.
*XDIM_MEMBERSET FABRICA_MAQ = <ALL>
*RUNALLOCATION
*FACTOR = USING/TOTAL
*DIM PRODUTOS WHAT=BAS(TOTALPROD); WHERE=BAS(TOTALPROD); USING=SP; TOTAL=<<<
*DIM TIME WHAT=2008.ORC;WHERE=BAS(2008.TOTAL); USING=BAS(2008.TOTAL); TOTAL=<<<
*DIM TIPO WHAT=BAS(TOT); WHERE=BAS(TOT); USING=ST; TOTAL=<<<
*DIM VARIAVEIS WHAT=MIXACABADA; WHERE=MIXACABADA; USING=DIASMES; TOTAL=<<<
*ENDALLOCATION
*COMMIT -
Use of MEASURES dimension in a RUNALLOCATION in a script logic
Hi everybody,
We are trying to use MEASURES dimension inside a RUNALLOCATION in a script logic, because we need to work with the information at a YTD element
Example:
It works:
*XDIM_MEMBERSET C_CATEGORY=%C_CATEGORY_SET%
*XDIM_MEMBERSET TIEMPO=%TIEMPO_SET%
*XDIM_MEMBERSET PRODUCT=BAS(TOT_PRODUCT)
*XDIM_MEMBERSET MARKET=BAS(TOT_MARKET)
*RUNALLOCATION
*FACTOR=USING
*DIM ACCOUNT WHAT=Cost; WHERE=Import; USING=Units;
// *DIM MEASURES WHAT=PERIODIC; WHERE=PERIODIC; USING=YTD;
*DIM CLIENT WHAT=CLIENTE_NA; WHERE=>>>; USING=BAS(TOT_CLIENT);
*ENDALLOCATION
*COMMIT
It doesn't work:
*XDIM_MEMBERSET C_CATEGORY=%C_CATEGORY_SET%
*XDIM_MEMBERSET TIEMPO=%TIEMPO_SET%
*XDIM_MEMBERSET PRODUCT=BAS(TOT_PRODUCT)
*XDIM_MEMBERSET MARKET=BAS(TOT_MARKET)
*RUNALLOCATION
*FACTOR=USING
*DIM ACCOUNT WHAT=Cost; WHERE=Import; USING=Units;
*DIM MEASURES WHAT=PERIODIC; WHERE=PERIODIC; USING=YTD;
*DIM CLIENT WHAT=CLIENTE_NA; WHERE=>>>; USING=BAS(TOT_CLIENT);
*ENDALLOCATION
*COMMIT
How can we do it? Is possible to use Measures dimension?
Any idea out there?
Kind regards
Albert MasHi Albert,
I believe you are correct that using MEASURES in this way is not possible. Depending on whether you have data in future periods, you may just be able to use the time dimension instead of the measures dimension:
*DIM TIME WHAT=2010.AUG; WHERE=2010.AUG; USING=2010.TOTAL;
You could also manually maintain a property and select on the property to do the same thing, which would allow you to exclude future periods.
Another option might be to make your Units account a balance sheet account, which should make it always behave as a YTD value, or create a second UNITS_YTD account as a balance sheet account and populate it with the Units YTD value using script logic before running the allocation, then use the UNITS_YTD account as your allocation driver.
Ethan -
How Acumulated Value in a script Logic
Hello,
We facing a problem here, that we cannot acumulated value using script Logic.
We need to calculated a account where we need the value to this account in the previous month
Like That
JAN FEB MAR APR MAY
ACCOUT
A 10 40 45 45 45
B 7 30 20
C 3 -15
In this case we need to save the acumulated value to all months, until the end of the year, even if we dont input value in this months.
Anyone facing this problem?
Best RegardsYou can't use a date display pattern on a text field, it has to be a date field.
The only way around that is to use scripting to format the date and then put the date in a text field - I've done this using util.printd() (I think - going off the top of my head at the moment) and there's a way to do it with FormCalc too.
Patterns work well once you get the hang of them. Display is how you want the data to look. Edit is the different ways you allow the data to be entered (multiple date, phone number patterns, etc.). Validate will validate that the Display pattern has succeeded. Data is the format to export.
I haven't had a chance to look at your new file but if you use 2 date fields with patterns you would just need: dateField2.rawValue = dateField1.rawValue; with dateField2 having date.long{} as the display pattern. Come to think of it you could use Global binding and give the fields the same name and you wouldn't have to do any scripting.
Radzmar has a good explanation of using multiple edit patterns for dates (English text is part way down): http://thelivecycle.blogspot.de/2011/10/date-patterns.html -
Calculate difference based on 1 dimension
Hi guys,
I have 1 measure SALES and 1 dimension TIME. How can I calculate the difference in sales between for example month July and August?
Kind regards,
DietrichTry below
First extract Month from Time dimension and crate it as measure.then create object with formulae and see it f it works
=SALES Where([Month]=[Month])-SALES Where([Month]=[Month]-1).
I am not sure if it works.Pls try yourself -
Can you calculate multiple text boxes to achieve a total value? If so how is that done? I am trying to create a order form where multiple items can be purchased but i would like the values of each item to calculate so I can achieve a total value.
Hi sashby51,
I've moved your discussion to the PDF Forms forum--the folks who visit this forum regularly should be able to point you in the right direction.
Best,
Sara -
I just want to calculate the quality of the peak in a FFT, defined as you can see in the attached file.
For that, I would need to know how can I calculate in Labview the index or indices (x-value) correspondant to a certain amplitude value of the function.
Kind regards, and thank you for reading,
Jose
Solved!
Go to Solution.
Attachments:
quality.jpg 6 KBIf you know the lineshape (e.g. Lorentzian), you can use nonlinear fit. This will give you the most accurate value.
In the most simple case (insignificant offset and noise, no other peaks) you can apply the following code (if there are other peaks, then take a apropriate array subset before applying the code). To get correct units, just scale with df.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
WidthAtHalfHeight.png 52 KB -
How can I calculate the value of the cell, which depends on other rows?
Hi, all!
I have an application with table. In this table i have calculate some fields, that doesn't exists in data class and depends on other row values, e.g. current row number, or sum of previous rows. How can i calculate this values in TableView?
The problem is that I have no information about the current row number in the cell value factory.
Example:
public class Transaction {
public String getName();
public BigInteger getAmount();
} // There is no getter for "Balance"
Result table should be something like this:
Name
Amount
Balance
transaction1
300
300
transaction2
200
500
transaction3
500
1000
Also, after sorting by "Amount", "Balance" should be recalculated:
Name
Amount
Balance
transaction3
500
500
transaction1
300
800
transaction2
200
1000Strings can be converted to numbers by various parse methods. For instance Strings can be converted to double via Double.parseDouble(myString).
That being said, it appears that your textfield will contain numbers and operators, and so these operators will need to be parsed too. I would advise you to search on the terms Java infix postfix. -
Can we have properties value of keyfieldvalue more than one value?
Hi all,
Regards File content conversion that we can have properties value of keyfieldvalue more than one value?
like a...
row.keyFieldValue = 'aa','bb'
I try define the value like this but I'm getting the error.
Thanks and Regards
ParkHi Park ,
There is an option of specifying generic modules for every adapter that is configured in the communication channel to modify the payload of an XI message . These modules equip the adapters with additional functions.
Please have a look upon the link :
http://help.sap.com/saphelp_nw04/helpdata/en/84/2e3842cd38f83ae10000000a1550b0/content.htm
I hope you can Module :'MessageTransformBean' .
*Pls: Reward points if helpful*
Regards,
Jyoti -
SSRS MDX Query Dimension Properties Missing
I have been stumped on this for a few days thought I'd throw this out here. I've read every related article in the forum regarding MDX Queries and Dimension Properties in SSRS Report Developer and haven't found a case exactly like this with a solution that
works.
Environment is SQL 2012 SP1 Cum update 5
I am doing a rather generic query out of MS Project Servers OLAP cube and I can't get the dimension properties to show up in the flattened output for my dataset. See below.
SELECT
NON EMPTY { [Measures].[FTE est] } ON COLUMNS,
NON EMPTY {
[Value_Stream_Project].[Value_Stream_Project].ALLMEMBERS *
[Project Status_Project].[Project Status_Project].ALLMEMBERS *
DESCENDANTS([Project List].[Project List Level 02].ALLMEMBERS)*
DESCENDANTS([ProjectManager_Project].[ProjectManager_Project Level 02].ALLMEMBERS) *
[Planner_Project].[Planner_Project].ALLMEMBERS *
[Time].[Month].ALLMEMBERS
DIMENSION PROPERTIES
MEMBER_CAPTION,
MEMBER_UNIQUE_NAME,
PARENT_UNIQUE_NAME,
LEVEL_NUMBER ,
[Project List].[Project List Level 02].[Start Date],
[Project List].[Project List Level 02].[Finish Date]
ON ROWS
FROM (
SELECT ( STRTOMEMBER(@FromTime, CONSTRAINED) : STRTOMEMBER(@ToTime, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@RBSResource, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@ProjectStatusProject, CONSTRAINED) ) ON COLUMNS
FROM (
SELECT ( STRTOSET(@ValueStreamProject, CONSTRAINED) ) ON COLUMNS
FROM [MSP_Portfolio_Analyzer]))))
My issue is the [Project List Level 02] dimension Properties (below) are not showing up in the Query designer output, aren't being generated as fields in the dataset and can't be referenced as a property in an expression (i.e. Fields!Project_List("Start
Date") )
[Project List].[Project List Level 02].[Start Date],
[Project List].[Project List Level 02].[Finish Date]
The odd part is if I change the above two rows in my query to this :
[Project List].[Start Date],
[Project List].[Finish Date]
The Query designer shows the properties in the output but leads to 2 other issues,
1) I have to modify the generated Dataset field values to remove the [Project list Level 02] in the Level unique name like this
Before<?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List].[Project List Level 02]" />
After
<?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List]" />
2) I have to restrict my cross join to only the current level (Level 02) or it expands the results to the parent hierarchy of the Project List dimension and skews my measure summaries.
I've tested the query in SSMS directly and the properties are showing up just fine for those dimensions using the original syntax.
Any help would be appreciated.Hi there,
Which data source provider are you using? Are the connection strings used in SSMS the same as SSRS? Doing a profiler trace against Analysis Services might point to differences in how the connection is made or query is parsed.
This may help.
http://www.sqlchick.com/entries/2011/10/23/pros-cons-of-using-the-ole-db-provider-for-ssas-100-when-rep.html
Did you try using With clause to make a friendly name for the member properties?
http://melick-rajee.blogspot.ca/2012/04/how-to-get-member-properties-in-mdx.html
cheers,
Andrew
Andrew Sears, T4G Limited, http://www.performancepointing.com -
How to calculate difference and percentage in matrix report dynamic columns in SSRS 2008
Hi Friends,
I need to calculate Difference and Percentage In matrix report SSRS 2008
1) Row grouping based On Product
2) Column Grouping Week and Fiscal Year Current week and Previous Year same Weeks
3)Data Invnetory(Value fileld)
Example:
If value1 and Value2 Available we need to calculate Percentage and Difference.Otherwise Not required NA I need to Show.
For example If Particular week,Current year data is available,Previous year week data is not available No
need to cal Diff and Percentage we need to show Empty.
Below Code is working for If two values is available.
If any one of the fiscal year week data is not there it's taking some garbage values.
I tries with If condition in GetPCT() and GetDiff() It's not working.
Can some one please help me on this.
I am using the custom code
Public Shared Value1 as String
Public Shared Value2 as String
Public Shared previous as string
Public Shared previousweek as string
Public Shared Function GetValue(Value as String,partner as String,Week as String) as String
If partner =previous and Week =previousweek Then
Value2=Value
Else
previous=partner
previousweek=Week
Value1=Value
End If
return Value
End Function
Public Shared Function GetDiff()
return Value2-Value1
End Function
Public Shared Function GetPct()
return (Value2-Value1)/Value1
End Function
How to handle this.
Thank You, Manasa.VHi veerapaneni,
According to your description, if one of the fiscal year week doesn’t have data, the custom code returns false results.
For your requirement, if NULL value exists in the database, we should replace it as zero then perform calculate. So within the code, we should judge whether the value is NULL. To achieve your goal, please refer to the steps below:
1. Create a table like below.
create table dif4
([Product Group] varchar(50),
[Week] varchar(50),
[Fiscalyearweek] varchar(50),
value int
insert into dif4 values
('Desktops','W01','FY14W01',0),
('Desktops','W01','FY15W01',45),
('Desktops','W02','FY14W02',null),
('Desktops','W02','FY15W02',30),
('Desktops','W03','FY14W03',12),
('Desktops','W03','FY15W03',50),
('Notebooks','W01','FY14W01',35),
('Notebooks','W01','FY15W01',56),
('Notebooks','W02','FY14W02',45),
('Notebooks','W02','FY15W02',87),
('Notebooks','W03','FY14W03',75),
('Notebooks','W03','FY15W03',105),
('Tablets','W01','FY14W01',34),
('Tablets','W01','FY15W01',46),
('Tablets','W02','FY14W02',49),
('Tablets','W02','FY15W02',96),
('Tablets','W03','FY14W03',42),
('Tablets','W03','FY15W03',113)
2. Add the custom code in the Report Properties.
Public Shared Value1 as Integer
Public Shared Value2 as Integer
Public Shared previous as string
Public Shared previousweek as string
Public Shared Function GetValue(Value as Integer,product as String,Week as String) as Integer
If Value=Nothing Then
Value=0
End If
If product =previous and Week =previousweek Then
Value2=Value
Else
previous=product
previousweek=Week
Value1=Value
End If
return Value
End Function
Public Shared Function GetPct()
If Value1=0 Then
return 0
Else
return (Value2-Value1)/Value1
End If
End Function
Public Shared Function GetDiff()
return Value2-Value1
End Function
3. Design the matrix like below.
4. Then get the expected results.<o:p></o:p>
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
[ASK] Get One Row of Property Value From Dimension in Script Logic
Hello, i need help about how to get one row of property value from dimension in script logic.
Let say there is CATEGORY dimension and the members are like this :
ID YEAR Status
PLAN_2011 2011 A
PLAN_2011_V1 2011 I
ACTUAL_2011 2011 I
FORECAST_2011 2011 I
FORECAST_2011_V1 2011 A
PLAN_2012 2012 A
PLAN_2012_V1 2012 I
ACTUAL_2012 2012 I
FORECAST_2012 2012 I
FORECAST_2012_V1 2012 A
If i scope CATEGORY like this :
*XDIM_MEMBERSET CATEGORY = [CATEGORY].PROPERTIES("YEAR") = "2011"
Then i will get member scope like this :
PLAN_2011 2011 A
PLAN_2011_V1 2011 I
ACTUAL_2011 2011 I
FORECAST_2011 2011 I
FORECAST_2011_V1 2011 A
Question :
In script logic, how can i read the second record of scope and move it to variable ?
Ex. : I read second record, so i can get the data of second record (PLAN_2011_V1, 2011, A).
Is there any function to read all record that had been scope ? So i can read all those 5 records.
Is there any substring or offset function in script logic ? How to use it ?
Thank you.Hi,
Firstly, when we scope the logic, it doesnt fetch the entire record from the member sheet. It just fetches the ID.
Secondly, we dont have the feasibility to read only the second ID and skip the others. However, one alternative is that you use the SELECT statement to store all the IDs in a variable, and then use a FOR loop. But this will loop through all the 5 IDs, as per your example. If you want to skip all the IDs except one, you should maintain some property, so that all the IDs are neglected which doesnt have a particular property value.
Hope you got the idea. -
BPC 7.5 MS - Integration Universe Designer - Access to properties values
Hello.
I am working with BPC 7.5 MS SP03, and I want to do some reports with Web Intelligence.
I installed the ODBO provider and I defined a Universe with Universe Designer. Now, my Universe has a class for every dimension of my AppSet, and I can do WebI reports with members of the dimensions and data. But what I want to do is to see
the properties values of the members in my BPC dimensions. For example, in BPC I have a dimension called Projects with several members (Proj1, Proj2, Proj3, etc). Each member has several properties (ID, NEWID, EVDESCRIPTION, PARENTH1, FORMULA, CLIENTID, CLIENTDESC, MANAGER). In WebI, I can only see the ID of the projects. How can I do a report filtering by any other property, like CLIENTID or MANAGER? Is this possible?
Thanks in advanced.
Best regards,
FernandoHi,
I believe this feature is not available in BO XI 3.1 when trying to access BPC data.
The only possible reporting possibility in WEBI is to see BPC members per level (LEV1, LEV2, etc...). From my experience, I would say that there is no filterining on properties.
But I guess that in BO XI 4.0, integration with BPC data will be more user-friendly and will offer a lot of other features.
Hope this will help you.
Kind Regards,
Patrick
Maybe you are looking for
-
CS3 Ext. Vista 64 jerky mouse movement
Hi there, I have a huge problem with my 32 Bit Photoshop CS3 Extended under the operating system Windows Vista Business 64 Bit and don't know if this is a known problem or has to do with the 64 Bit or something. I don't know what to do more so I ask
-
Hi All, My SAP system is very slow while doing FBRA tranaction in production clinet. Please tell me what is reason to getting the slow the same. Best Rgds Suma
-
Color Management, (Again!)
I know this has been discussed before, but I still haven't found anything that can help me solve the issue. It's starting to become a serious barrier to professional work, so any thoughts woudl be appreciated. I have both the eye1Display2 and a Greta
-
Any Ideas How I can Make this Formating Program Run Faster?
I'm using LabView 8.0.1 to extract columns and rows from MS Excel to format to a specific format which can be read into a software program we use in-house. The software program requires a specific header which declares variables, etc and also fomats
-
Need a little JavaScript help with disabling a select list in a tabular frm
Hello Folks Here's the scenario. I have a tabular form which, subject to the setting of one Select List, I want to disable/enable another. I have got this far and it will disable a text item but not a select list.. This is in the HTML header section