Replacement path variable for date not working

We have a formula variable using replacement path (BEx 7.0) for a date field and after that we have calculated key figures to perform date difference calculations.
This was working perfectly well until recently when the calculated key figures displayed an "X" instead of the value.
The value seems to appear only when the date fields are drilled down in the report.SO this works like a formula instead.
Is this just an unnatural case where something just stopped working ?
We have checked the calculated key figures and the formula variables , they havent been changed in the recent past.
Is there any other solution you could offer to get date differences without having the date fields in the rows ?
Edited by: ABCD on Jul 29, 2009 2:28 PM

How to use Replacement Path Variables to perform Date Calculations
A Step-by-Step guide
Have you ever wanted to perform calculations using dates defined as characteristics but have never worked out how it can be done? Replacement Path Variables are the key.
Using Replacement Path in your Text and Formula variables, replace values held in a characteristic. The Characteristic value variables are replaced by the results of a query at run-time.
The steps detailed below show a technique to enable a BEx query user to determine the number of days between two dates.
Scenario:
The group HR administrator wants a detailed line item report that lists all employee absences in a given period. The report is to show the employee number, the absence start date, together with the end date of the absence and show the number of calendar days the employee was absent.
The good thing about using this technique is that no redesign work is needed from your technical BW team, no ABAP is involved and best of all, it quick and easy.
Solution:
For this example I created an ODS object called Absence that holds basic employee information along with individual absence record data.
Follow the steps below:
1.     Open the BEx Query Designer and create a new report on your chosen InfoProvider.
2.     Drag the Employee, Valid from and Valid to characteristics into the Rows section of the screen.
If needed, apply data selection restrictions to the characteristics as shown in Figure 1.
3.     Right click on the Key Figures structure and select New Formula (Figure 1).
Figure 1
4.     
5.     In the new formula window right click on Formula Variable and choose New Variable ( Figure 2 ).
Figure 2
6.     
7.     The Variables Wizard will launch and will require you to specify the variable details.
( Click the NEXT button if the Introduction screen appears )
8.     Enter the variable details on the General Information as shown in Figure 3 .
Enter the Variable Name , Description and select Replacement Path in the Processing by field.
Click the Next Button.
Figure 3
9.     
10.     In the Characteristic screen (Figure 4) select the date characteristic that represents the first date to use in the calculation (From Date).
Click the Next Button.
Figure 4
11.     
12.     In the Replacement Path screen (Figure 5) select Key in the Replace Variable with field. Leave all the other options as they are (The offset values will be set automatically).
Click the Next Button.
Figure 5
13.     
14.     In the Currencies and Units screen (Figure 6) select Date as the Dimension ID.
Click the Next button.
Figure 6
15.     
16.     The Save Variable screen (Figure 7) displays a summary of the new variable.
Click on the Finish button to save the variable.
Figure 7
17.     
18.     Repeat steps 4 to 11 to create a second variable for the second date to be used in the calculation.
In the example shown, the characteristic 0DATETO is used to create the variable ABSEND (Absence End Date).
Define the Calculation
We can now use our two new replacement variables to define our new calculated key figure that generates the number of absence days for each record.
1.     You will now be back at the New Formula screen (Figure 8). Drag and drop the two new variables into the formula section of the screen and insert the subtract sign (u201C-u201C) between the two.
2.     Give the new formula a description and click the formula syntax check button  to ensure the formula is valid.
Figure 8
3.     
4.     The new calculated key figure will now show in the columns section of the BEx query designer (Figure 9).
Figure 9
5.     
6.     Save the query and execute it.
In the example shown the Number of Calendar Days Absent is calculated correctly. See the table of results below.
Employee     Valid From     Valid To     Number of Calendar
Days Absent
50000001     17/04/2004      21/04/2004      4
50000002     16/07/2004      29/09/2004      13
50000003     07/01/2004      09/02/2004      33
50000004     04/08/2004      05/08/2004      1
Cheers:)
Vivek

Similar Messages

  • Evaluate function to convert presentation variable to date not working..

    Hi,
    I have a calendar prompt on my dashboard and the presentation variable for this prompt is PV1.
    I am using this variable in my report to create a calculated column. The condition for the calc column runs something like
    case WHEN "Time"."Day" >= ANY(SELECT saw_3 FROM(SELECT "Time"."Start Date" saw_3 FROM "xyz_subject_area" WHERE "Time".Day = CAST(EVALUATE('TO_DATE(%1,%2)' AS DATE, '@{PV1}{@{system.currentTime}[MM/DD/YYYY]}', 'MM/DD/YYYY HH:MI:SS AM' ) AS DATE)) EX1) then "ABC"."Units" else "XYZ"."Units" end
    However when I checked the expression EVALUATE('TO_DATE(%1,%2)' AS DATE, '@{PV1}{@{system.currentTime}[MM/DD/YYYY]}', 'MM/DD/YYYY HH:MI:SS AM' ) is not returning the date always. I am not sure why for some rows it is working correctly and for some it is not returning any value.
    Please let me know if there another better way to convert the presentation variable value to date.

    Hi User,
    What is the data type of the column you are using in the prompt?
    I think a datetime data type will by default cause OBIEE to wrap the presentation variable in the TIMESTAMP syntax if you just do this '@{PRESENTATION_VAR}'.
    If you, did not base it on the datetime data type, then try the following:
    cast( LEFT( '@{MY_DATE}' ,4 ) || '/' || SUBSTRING( '@{MY_DATE}' FROM 6 FOR 2) || '/' || SUBSTRING( '@{MY_DATE}' FROM 9 FOR 2)||' 00:00:00' as date)
    In order to use OBIEE to cast as a DATE, your string needs to be in the form YYYY/MM/DD HH24:MIN:SS
    Good luck!
    -joe

  • Interactive report filter for date not working correctly

    Hi,
    I am having an interactive report. I tried to give a filter for a column(created_on) as created on>29-oct-2009 17:17
    but i am getting the row containing created on as *29-oct-2009 17:17* in the report result. How can i correct this
    problem
    Thanks,
    TJ

    Hi,
    I think it is because seconds.
    So it is 29-oct-2009 17:17:00 and your record is e.g. 29-oct-2009 17:17:02
    br, Jari
    Edit
    You can use trunc function in your select so that it round date to minutes
    TRUNC(created_on,'MI') AS created_onBr, Jari
    Edited by: jarola on Nov 5, 2009 3:02 PM

  • Replacement path variable is not working

    Hi Experts,
    I have created a input ready query & assigned it to a  Web template.
    In query filter, I have used char. 0SALESORG restricted with manual input variable.
    In row, I am using custome defined char. Market with master data as a access type. Market is display attribute of 0SALESORG.
    My requirement is whenever user selects a value for 0SALESORG through variable same values should be displayed in row for char. Market.
    I tried to achieve this requirement using replacement path variable on char. Market.
    But, I am not getting the required output.
    Correct me if I am doing any mistake / suggest any other feasible option.
    Thanks in advance,
    Shamkant.

    solved on own.

  • Replacement Path variable--not working

    Hi All,
    I am using replacement path variables in a query. The scenario is like this:
    In Query 1 I have Region, Market, Group, Item in the rows and in columns I have a keyfigure and fisper. All the user-input variables. And I have a condition which shows only those records where keyfigure = 0 for the range of periods entered.
    In Query 2, I am using same char's in rows but they are replacement type variables. Also the fiscper is RP variable all from result of query 1. Key figure is different here. So, my query 2 should return all the chars from query 1 result and should give the values of the query 2 keyfigure for the results of query 1 for the same range of periods.
    But for some reason I am not getting the result values of query 1 but getting all the values entered in the selection screen.
    Can anyone please help me out of this issue.
    <removed by moderator>
    Thanks and Regards..
    Edited by: Siegfried Szameitat on Nov 7, 2008 9:05 AM

    Hi Rahul,
    This issue almost drove me to distraction and I found no solution. It appears as soon as you are working with mor than one variable with replacement by query results.
    Simplified :
    In Query1 you have two combinition for region and market in query result e.g.:
    regionA  market1
    regionB  market2
    In Query2 the replacement is
    regionA  market1
    regionA  market2
    regionB  market1
    regionB  market2
    i.e. all possible combinations from result of Query1.
    Good Luck
    Joe

  • Formula variable with replacement path on system date

    Hi Experts,
    I got a requirement to calculate "Days without payment" in report level.
    Days without payment = System Date - Payment Date.
    (Payment date field is available in CUBE, but system date field is not available in the CUBE)
    As we know, the difference b/w 2 dates is not possible directly.It can be possible by creating 2 formula variables with replacement paths on the dates and by writing aformula on these 2 formula variables.
    But the thing is I dont have system date readily available, and I tried by using SAP Exit. But we cant create formula variable replacement path on another variable (SAP EXIT).
    Do we have any SAP variable  for formula with replacement path readily avaliable to get system date (or) any other suggession.
    Please suggest me.
    Thanks,
    Sai Chand.S

    Hi Arminder,
    Thanks for your valuable answer.
    I tried doing the same previously.As u said we can get system date by creating customer exit variable.
    But the thing is to find difference b/w 2 dates, we cant do it directly, we need to create 2 formula variables with replacement path.
    1) Var1 = Formula variable with replacement path on system date(custoer exit variable).
    2) Var2 = Formula variable with replacement path on paymanet date.
    Number of days = var1 - var2.
    But as in 1st point, we cant create formula variable with replacement path on another variable, as system date is already a variable of type customer exit.
    We can create replacement paths only on characteristics.
    Please suggest me .
    Thanks,
    Sai Chand.S

  • How to use Replacement Path Variables to perform Date Calculations

    Hi Experts,
    Can anyone make me clear about:How to use Replacement Path Variables to perform Date Calculations???????
    Thankyou in advance..
    shankar

    In left panel select the time Dimension
    Then hit new variable in that
    give the Name and Description for the Variable
    In processing by hit Replacement Path
    In reference characterisitcs use Calendar Day...
    As ur intention is to use it for Date
    Then in adjacent tab use
    Replace variable with Query / Variable
    Then u can use Offset length and offset start for controoling the display of your variable.
    Use as single, multiple single, interval, selection option as uwish
    HIt okey
    and you are good to go

  • How to get a replacement path variable working in same query

    Hi All
    I have a query in which the user enters a value for the 0fiscper variable. Our users want to display for the last 12 months the previous year same period sales.
    I do this by putting a value range offset restriction on 0fiscper varianle to -12 to 0fscper variable value. I have 0fiscper as drill down on the rows.
    Fiscal Year period                LY Month Sales
    010/2010                                  9999.89
    011/2010                                    8888.99
    To get the LY Month Sales I would like to set up a replacement path variable on 0fiscper so if the value of 0fiscper on the
    row is available in the replacement path var I can offset it ti -12 to get the LY Month Sales.
    Can someone share ideas how I can set up this replacement path variable.
    Thanks
    Karen

    Hi,
      Why u want to go for replacement path. You can attain your result bu just offsetting the fiscyear period variable.
    Regards,
    Raghavendra.

  • Formula variable for date calculations with date-characteristics (2004s)

    Hi SDN,
    I'd like to calculate the number of days between to date-characteristics. In 3.5, I was used to create 2 formula variables of the type 'replacement path', with 'date' as the dimension indicator. In my formula, I used the 'proces value as date' function for each variable, and I could perform calculations with them.
    I'm trying to do the same in 2004s. However, I can't create replacement path's with 'date' as a dimension indicator. So I use 'number' instead, but it doesn't work: my query shows 'x'.
    I can use the variables that I created using the 3.5 query designer as a workaround. But I hope there is a better solution.
    If other people experience the same problem, please respond. Then I know it's probably a bug.
    Kind regards,
    Daniel

    Daniel,
    Try to look at the formula variables defined before the upgrade and see what is different to the newly defined. I am guessing just the terminology used is different.
    If not the date value might be blank or something for one of the f-variables used. Try to display the formula variable values as KF in the query results and check what it is showing.
    I hope this helps.
    -Bala

  • Replacement Path Variable with Another Variable

    Hi,
    I am currently trying to create a report that would need me to have the same values for different characteristics (e.g. clearing date, posting date, net due date). I have seen that there is a way in the replacement path variable that would replace its value with another variable that is ready for input. I also looked into SAP help but I can't seem to figure out on how to do it specifically. Does anyone know a step-by-step process on how to do this? How does this work?
    Thank you in advance!

    take an e.g.
    u have characteristic say ch1
    u want to restrict it with replacement path variable
    first of all create a variable var1
    click what it is based upon for e.g. 0calday, 0material etc.
    make it user entry variable
    select single or multiple entry
    make it mandatory
    save it and hit okey
    click on ch1
    right click and say restrict
    in new window create a new variable
    give its name and technical name
    processing path is replacement path
    go to next tab of replacement path
    select several ooptions
    replace variable with another variable
    select a variable called var1
    change the offset length and offset start with different parameters.
    hit okey
    this way u have restricted ch1 with replacement path variable var1
    now when u run report u have to enter value of var1
    which will then further feeded to ch1
    this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
    make sure as this ur requirement is date
    try to use 0calday as reference infoobject all the times....

  • Issue with the Replacement Path Variable.

    Hi,
    I have an issue in using the Replacement Path Variable.
    Issue: I have Sales information in the Sales Cube and AR information in the Accounts Receivable cube. Now we have a requirement to show the open AR documents with Sales information in it.
    Apparently the system generates same number for both AR and Billing document.
    So I thought of using the Replacement path variable in the Sales Query on Billing Document, so that it runs the AR query to get the list of open AR documents into the Sales query. But the system is complaining:
    "System error in program CL_RSR_OLAP and form IF_RSR_OLAP~MODIFY_VQUERY_SETTINGS-01- (see long text)".
    I searched OSS note on this and found the note: 1432062. Implemented, but now it complains:
    "Abort Variable XXX cannot be replaced in this query".
    I am trying to return the result from Accounting Document to the Billing Document. I know this is an issue, but after implementing the Note, i thought it would be fixed. But no luck.
    Did anyone come across this situation. If you have any solution for this, pls let me know.
    Thanks.

    Hello;
    Why don't you try to add the billing document in your financial cube;
    mapping it with the a ccount document number?
    This should make the replacement path work fine.

  • Replacement path variable with offsets

    Hi experts,
    I have the requirement to report receivables (open items) historically by fiscal year / period.
    More precisely, each period should show the open items that are open at the end of the period.
    Example:
    001.2010 (shows open items from 31.01.2010)
    002.2010 (shows open items from 28.02.2010)
    ...etc.
    The idea is that the user enters a fiscal year/period using a manual entry variable.
    The open items should be calculated as follows:
    KF: Amount
    Posting Date <= Variable
    Clearing > Variable or unassigned
    Variable is a replacement variable that is replaced by attribute "Date To" from the user entry Variable (Fiscal year period)
    E.g. if the user enters 008.2010, then this value is automatically replaced by 31.08.2010.
    Generally this works.
    However, to view the values for the last 12 months, a structure is needed consisting of 12 elements with offsets in order to show the 12 months prior to the selected period (e.g. 001.2010 - 002.2010 - 003.2010 ....etc.)
    The problem is that the replacement only considers the user's variable entry and ignors the offsets.
    Example:
    User enters 008.2010.
    In the column strucure I show 3 months 006.2010, 007.2010, 008.2010.
    Then all columns would show items open on 008.2010 - the offsets are ignored.
    Any idea, why this happens and how it can be resolved?
    This problem has given me a headache for days.
    Your help is much appreciated.
    Thanks and regards,
    Alex
    The user should be able to enter a fiscal year / period and

    take an e.g.
    u have characteristic say ch1
    u want to restrict it with replacement path variable
    first of all create a variable var1
    click what it is based upon for e.g. 0calday, 0material etc.
    make it user entry variable
    select single or multiple entry
    make it mandatory
    save it and hit okey
    click on ch1
    right click and say restrict
    in new window create a new variable
    give its name and technical name
    processing path is replacement path
    go to next tab of replacement path
    select several ooptions
    replace variable with another variable
    select a variable called var1
    change the offset length and offset start with different parameters.
    hit okey
    this way u have restricted ch1 with replacement path variable var1
    now when u run report u have to enter value of var1
    which will then further feeded to ch1
    this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
    make sure as this ur requirement is date
    try to use 0calday as reference infoobject all the times....

  • Replacement Path Variable on InfoSet

    Hello people,
    I have some queries based on InfoSets and I am not being able to use already existing replacement path variables on any date-type infoobjects of the infoset.
    These date infoobjects do exist in the infoset (are flagged as part of the infoset definition),  however it seems that the Query Designer does not recongnize them as the real infoobject (consider that within the query designer each infoobject of the infoset appear not with its real tech name, ex 0DOC_DATE, but with a different tech name specific for the infoset,  example: ZPUR_I05__F91;  F92 and so on..). 
    So it seems that because of this, the Query Designer thinks I'm trying to use a Replacement Path variable on an InfoObject that doesnt exist in the InfoSet,  which is not true.
    Does anybody went through this situation,  and how can it be solved?
    Many thanks to all in advance.
    Fernando

    Hi there,
    solution I found is to create new Replacement Path variables, based on the InfoSet objects. 
    Although they are technically the same infoobjects the Query Designer treats them as different objects.
    cheers,
    F.

  • Replacement Path variable with query

    Hi all,
       I have a replacement path variable in a query that use the result from other query (a pre-query), both of them use the same variables, exactly the same, although the query ask me for the values of the variables twice (for the query and for the pre-query), is possible that the query ask me for the  variables only one time (re-use the same values for both queries)?
    Thanks,
      Javier

    If possible use only the variable with replacement path on the query. Since the Pre-query has all the same variables as the main query, the user would enter all the required input on the pre-query one time. The result of the pre--query feeds the main query. If the main query has no other selection variables except for the replacement path, the selection screen will not pop up again.
    Thanks
    Vineet

  • Replacement Path variable cannot be used in filter

    After creating a variable of type replacement path with query I get the error message:
    Errors: Variable ... cannot be used in 'Filter' 'Default Values'; remove
    Does anyone know what is causing this message and how to prevent it?
    Thanks.
    Regards,
    József.

    Thanks for your response Bhargava,
    Your answer did help me find the solution. When using a replacement path variable with query, you can only use the variable in the Characteristic Restrictions part of the Filters (not in the Default Values).
    The characteristic itself can still be used for navigation.
    p.s. Found that when copying a query some links to structures, like restricted key-figures, are kept in the metadata repository, even after removing them from the query. This can also cause error messages.
    Regards,
    József.

Maybe you are looking for