Restrict on a "Date" type (key-figure)

Hello, all
1. I need to define a query, to compare the planed-date and the current-date(today), if planed-date>today, then in the new column, the firstday of the month will be listed
(e.g. 1-12-2005).
could you give me some suggestion, how can I found the functions of reading date in Query Designer.(I didn't find any function in the Form).
2. Any how can I add Macro in the report? is there some document I can read in SDN?
Many thanks
Tony

Hi Tony,
I don’t know details about your infoobjects design tech aspects. Hence, I propose that what will work. You can adjust your design accordingly.
I encountered a problem while working with dates determined as key figure attribute.
But with dates as reference to 0CALDAY attributes everything works.
So, we have a Project infoobject. Create plan-beg-date and plan-end-date characteristics with reference to 0CALDAY. Assign them as attributes to Project. For testing purposes enter manualy several master data for it. Insert it as a data target (RSA1, infoproviders area). If you have a cube with the Project, then you don’t need the previous step.
In BEx, create a V1 formula variable for plan-beg-date: replacement path, char = Project, Replace var with = Attribute value, Attribute = plan-beg-date, check ‘To value’.
Similarly, create V2 formula variable for plan-end-date.
Create in columns a new structure. If you work with Project infoobjects as infoprovider, put into structure ‘Number of records KF’, otherwise the following steps might not work.  Add into the structure a new formula = V1, new formula = V2, new formula = V2 - V1. It will give you the the planned duration of the project.
Now, create X1 & X2, two customer exit variables on 0CALDAY. Based on either user entered reporting day or on current sys-day they should return the first and last days of the reporting/current month.
In the structure create another formula for corrected beginning date:
DATE ( ( 'V1' < 'X1' ) * 'X1' + ( 'X1' < 'V1' ) * 'V1' )
and a formula for corrected ending date:
DATE ( ( 'V2' > 'X2' ) * 'X2' + ( 'X2' > 'V2' ) * 'V2' )
Now you can calculate planned days for the reporting month or even the total number of project plan days.
About macro – you execute a query, embed it into a workbook, write a macro and save the workbook. Next time you’ll open the workbook in Analyzer.
Best regards,
Eugene

Similar Messages

  • Key Fields, Data Fields, Key Figures and Characteristis, Dimesions & Key Fi

    Hi All,
    Can any one please describe more about the below terms and with the Example....
    Like when we identify which one is Key filelds and Data fileds, how to distingush creating new dimesions (Is it based on user reporting) Key figures in Dimestions...
    DSO/ODS:  Key fields, Data Fields
    InfoCube: Dimensions, Key Figures
    Infoobjects: Key figures, Characteritics
    Regards,
    Prem

    Hi,
    Search through SDN for more information on these concepts,
    Re: ods data fields or key fields?
    Re: Key Fields and Data Fields in ODS
    defining Key -field and data fields
    Regards,
    Mani

  • Sort data by key figure in Query Designer

    Hi Gurus,
    Is it possible to sort a query according to a key figure from Query designer?
    Thanks

    Using condition TOP N is the solution

  • No data in Key Figure

    I have assigned Goods Issue Date field to 0CALDAY and 0GIDATE. In the cube I can see data in 0CALDAY, but there is no data in the 0GIDATE column. Equally, I don't see any data in 0ACT_GI_DATE(Key Fig).
    0GIDATE and 0ACT_GI_DATE are defined as Key Fig with aggregation Max and Last Value. Please advice if there is any discrepency  with definition. Transformation and DTP are fine and I can see data in the PSA though.

    Hi Latha,
    in my system 0GIDATE is a date in decimals, so it expects a decimal for calculation
    0ACT_GI_DATE is referenced to 0DATE and not 0CALDAY...That might be the reason why you do not have any information.
    Try with constants to see what it expect really.
    PY

  • About value type and key figure type

    Hello Gurus,
              please explan the different usage of about value type and key figure type.  what is the typical values for both infoobjects ?
    Many thanks,
    Frank

    Hi,
    0METYPE is a key figure-specific info object usually used to define semantics of the individual business key figures in BW (for example, actual, commitment, plan, target values).
    Its a bi specific field which is filled from extract structure field named MEASTYPE table COSR
    Refer to OSS Note 523742 for how it is filled and the following link for additiona information.
    http://help.sap.com/saphelp_nw70/helpdata/en/91/ddd52b9ef30645a338e28aae443807/frameset.htm
    Note 523742 - BCT-CO: BW key figure model and R/3 tables for trans. data
    This note provides information on the key figure model in the area of BW Content CO-OM. It also gives an overview of the DataSources for transaction data and the corresponding source tables and value fields in the R/3 System.
    The key figure model for currency fields in the area of CO-OM contents affects the following info object of type key figure:
    0AMOUNT Amount
    The key figure itself does have any business semantics.
    The semantics of the individual business key figures in BW (for example, actual, commitment, plan, target values) is determined using combinations of values for the following key figure-specific info objects (see also the account model in SEM-BPS, note 407563):
    0METYPE Key figure type
    0VTYPE Value type for reporting
    --> 0VTDETL Details of the value type
    --> 0VTSTAT Statistics indicator for the value type.
    For example, using transaction SE16, the possible characteristics of the values of this InfoObject can be taken from the above-mentioned master data tables in R/3.
    The business key figures on the InfoCubes of the standard BW content were defined as restricted key figures using this semantics of the key-figure-specific characteristics.
    The conversion of the R/3 transaction data in the BW key figure model is carried out in the extractors using the ROMI_GET_VTYPE_AND_DETAIL function module. It primarily happens using the specified conversion tables.
    The following dependencies exist for the source tables of the DataSources:
    COSP_VTYPE for COSS, COSP, COVP,
    COSB_VTYPE for COSB,
    BPXX_VTYPE for BPGE, BPJA, BPEE
    If an R/3 source record cannot be converted using these tables, it may not be extracted to BW.The application log of the R/3 DataSource transaction RSA3 contains entries for the unconverted values after the test run.(The log function for the CO-OM DataSources was considerably improved by the correction for note 523655).
    The application log for the extraction runs from BW can be evaluated using transaction SLG1 (Object: RSAP, object information: RSAP_INFO)
    Furthermore, the semantics of a key figure are still determined by the time characteristics and the following key-figure-specific info objects:
    0CURTYPE Currency type (for more information, see note 517909),
    0DB_CR_IND Debit/credit indicator (for more information, see note 065075),
    0VERSION CO version
    -Vikram

  • Restricted Key figure in Qery

    I have a critical problem - many points for a solution :). In my cube (Purchasing data - 0PUR_C01) I have several invoices that correspond to a material. Each invoice has an invoice date and an invoice amount;
    Cube contents:
    Material A - 2004-01-14 - 1000 USD
    Material A - 2004-03-05 - 1500 USD
    Material A - 2004-12-20 - 1700 USD
    Material B - 2004-03-15 - 100 USD
    Material B - 2004-04-17 - 200 USD
    Material B - 2004-11-30 - 300 USD
    Now, in the report I need to define a restricted (or calculated, or anything) key figure containing the amount from the latest invoice for each material. In the examples above the result would be:
    Material A - 1700 USD
    Material B - 300 USD
    The restricted key figure is later to be used as a base in price development calculations.
    How can I solve this, if it’s not possible to solve in the report I’m ready to restructure the flow.

    Hi Daniel,
    You can achieve it with the Aggregation settings of the Key Figure as follows:
    Aggregation: SUM
    Exception aggregation: Last value
    Agg. referen. char 0CALDAY or whatever temporary characteristic you use in the cube.
    You must consider that this setting will affect the KPI aggregation procedure and probably this won't be the expected result in the other queries so you better create a copy of the KPI with this settings and map it with initial KPI in the Update rules of the cube.
    Hope it helps,
    Andreu

  • Calculation based on date key figures in BEx

    Hi Friends,
    Hi Friends,
    I need to creat report for sales order data, which involved the calculation based on dates.
    In my cune iam having the data at the granual level with the dates as key figures. the calculation that i need to do is VTW = Actual PGI date - Customer want date.
    1) whn i run the report at the granual level my VTW is working correctly. No issues.
    2) when i run the report at higher levels the date fields are updated with X, as the system is unable to aggrigate the dates. The dates are at the material level in  a sales order. I need to show the VTW at the sales order level (each one of the two dates are same for all the materials). So, when i run the report with out mataril at the sales order level...i wanto sea the bothe date fields in a single line and also the VTW calculated as the different between throse two dates.
    3) Once we get the VTW correctly at the sales orde level. if i drill down the report for material, i want to sea both the dates in every record againest the matarial, but the VTW only aginest the first record...that is againest the sales order. I dont waht the VTW value repeated/duplicated for all the records againest the sales order,as VTW makes sence only at the Sales Order level.
    Please suggest me hwo i can achive the resulsts by meeting both Point 2 and 3.
    Thanks for ur help...in advance.
    Thanks,
    Renu

    Hi..
    I have the data from the extractore and in the cube as below.
    SALES ORDER    ITEM                MATERIAL            DATE1                         DATE2
    101                        Item1               Mat1              01/01/2010                15/01/2010
    101                        Item2               Mat2              01/01/2010                15/01/2010
    101                       Item3                Mat3             01/01/2010                15/01/2010
    I need the reports as below...
    Report1:
    SALES ORDER        DATE1                         DATE2                  VTW (DATE2 - DATE1)
    101                        01/01/2010                15/01/2010                14
    currently iam getting this Report1 output as below...
    SALES ORDER        DATE1                         DATE2                  VTW (DATE2 - DATE1)
    101                             X                                   X                           42
    Report2: Out put required as below
    SALES ORDER     ITEM                MATERIAL            DATE1                         DATE2      VTW (DATE2 - DATE1)
    101                        Item1               Mat1              01/01/2010                15/01/2010              14
    101                        Item2               Mat2              01/01/2010                15/01/2010
    101                   I     tem3                Mat3             01/01/2010                15/01/2010
    currently iam getting this Report2 output as below...
    SALES ORDER     ITEM                MATERIAL            DATE1                         DATE2      VTW (DATE2 - DATE1)
    101                        Item1               Mat1              01/01/2010                15/01/2010              14
    101                        Item2               Mat2              01/01/2010                15/01/2010               14
    101                   I     tem3                Mat3             01/01/2010                15/01/2010               14
    As VTW is need to be measued at the sales order level and we always have the DATE1 & DATE2 as same for all the itesm, it should be shon as only 14 in the first record. It mean once iget the required output from Report one in a single line with VTW as 14, it should not repeat with every line , when i dril down the report for Items or materials.
    Even if i can generate oly report2 as required in a single sheet ...that will be enough.
    Plas kindly provide some solution as how we can achieve this,
    Thanks,
    Renu

  • Adding key figures using commands in Web Application Designer?

    Hello, all.
    I have a query the contains several key figures.  From that query, I created a query view in which only one of the key figures is displayed.  I'm using this query view for one of the data providers in a web template.  In Web Applicaiton Designer, I would like to be able to hide the key figure from the data provider and show a different one.  How can I accomplish this using the built-in commands?
    I know I can hide all key figures using the CLEAR_SELECTION_STATE command, but I can't figure out how to use a command such as SET_SELECTION_STATE_SIMPLE to show a different key figure.  Any help would be great!  Thanks.

    I've tried that using the GUI to configure the command, but WAD crashes when I try to open the window where I choose the member name.  The error says:
    "4A6DM1A4LTXPJKA1BA3LD9TTD is not a valid characteristic for InfoProvider MQM_M01."
    I also tried entering the commands as you suggested in the XHTML editor, but that resulted in an error when I tried to execute the command.
    Maybe I can do what I'm trying to do using some method other than changing key figures.  Basically all I want do is change the date range of the data shown using offsets.
    The key figures that I'm trying to add and remove are restricted in Query Designer to different date ranges.  These date ranges use offsets to set the restriction.  For example, one key figure is restricted to display values for only the last 7 days and I'm trying to replace it with a key figure that's restricted to the last 14 days.
    If I knew how to set a filter with offsets using commands in WAD, then I'd use that method, instead.  Any suggestions would be appreciated.

  • How to controle the output of a key figure based on an attribute

    As part of following up on a select range of materials during their launch period a report is needed, where the key figures are controlled by a specific attribute.
    The attribute is called End Launch Control Date and it holds the specific day where the product goes from launch to replenishment. When the product goes into repleneshment it is no longer relevant to follow up on.
    The follow up list contains around 80 materials (SKU's) and the challenge is that they have different End Launch Control Dates.
    So, I would like to design a report that does the following:
    1) When drill on material, the key figures only show values before the End Launch Control Date for the specific material. After this date, the key figure should state either zero or blank cells.
    2) The key figures should not be controlled by a specific date in the prompt, because the End Launch Control date is different for each material.
    Does anyone have experience in constructing this functionality?

    Hi,
    you could maybe do this with using formula variables and and IF statement in the keyfigure you want to be blank after a certain date
    basically you want/need to compare a date (which date would that be, one in the columns or smth?) with the end launch control date and if this date is bigger then this leave KF 0.
    so you need to create a formula using two formula variables (of type replacement path and being replaced by the 2 dates) and compare these two in the formula. Then you use the outcome of this (which should be 0 or 1) in a new formula with the keyfigure (statement true * KF ) + (statement false * KF). This will give a value when comparison is ok and 0 when it is not ok.
    This description might be not complete and bit short but I dont have the time to fully look it up, please let me know if you didnt understand the idea behind it.
    Regards
    C.

  • Crystal Report Key figure formatted value

    Hi,
    I have restricted key figures defined in my BEx query based on a 'Quantity' type key-figure. I have maintained a display setting for these RKFs restricting to just one decimal place (10.0). Now I am trying to make use of this format setting in my Crystal report built on top of the BEx query by dragging in the 'Key Figure formatted value' node into my report. Although crystal report gives me the formatted value of one decimal place (10.0), it also attaches a Unit symbol next to the value (10.0 KWH)
    How do I suppress the Unit of Measure for the measure in my report?
    Thanks
    SR

    HI SR,
    If you are not doing any calculatins with this field, then use the following :
    Left('10.00',(instr('10.00','.')+1))
    Note : replace '10.00' with your field.
    Thanks,
    Sastry

  • Trade Funds report to update Settled key-figure for rebate scenario

    Dear Experts,
    We have a scenario where we are triggering rebate creation in ERP from Trade Promotion in CRM.
    The rebate accruals are generated over a period of time based on sales orders.
    Now we have 3 standard SAP Trade Funds reports which helps us in extracting the accruals data from ERP rebates and updates "Accrual Balance" key-figure of the Fund associated with the Trade Promotion.
    Now in ERP once the rebate settlement is created, is there any standard SAP report which will update the "Settled" key-figure in the Fund.
    Please advise.
    N.B. Our scenario has TPM integrated with Trade Funds & we are using CRM 7.0 EhP1
    regards
    Animesh.

    Many thanks for ur replies!
    problem here is that, since i had declared this  particular fileld as a integer type key figure, it is not allowing me to enter characteristic values in  update formula .
    and venkat, how can i change that key figure to char? is that possible? they have specifically told to write as a key figure. and in this model we have only one key figure ( this particular field ).
    that infoobject is not available in BW as of now. so i had created it as a key figure as was told by them.
    Thanks,
    Ravi

  • Mandatory Variable in Key Figure(new selection) does not give Input Screen

    Hi,
    I have created a query based on a Multiprovider, which uses 0FIGL_C10 & one target DSO.
    In colums I was trying to create one new selection type key figure using 0BALANCE infoobject, restricted it by 0FISCYEAR using one mandatory variable. When I am executing this query fiscal year variable is not asking for any value as input.
    Being it a mandatory variable it should ask for some input, which is not happening.
    Please suggest if I am missing something here or there is some problem with the SAP.
    Regards,
    Lokesh Kumar
    +91 9871097220

    Only making a variable mandatory will not make it input enabled...it should be also " Variable ready for input" then only you will get input screen.
    Rgds
    Amit

  • Key figure values in MC$K not updated

    Hi
    I have a situation where I run transaction MC$K (Material Analysis: On-time delivery: statistics):
    At first I had not done any config in transaction MCFC for the deviation of delivery date. So when I ran MC$K, the delivery date variance key figures showed zero (0).
    Then I updated the variance intervals in transaction MCFC and reran the report. Still did not show anything for the old purchase orders, but for any new created PO/GR that that I did after my settings in transaction MCFC are taken into account.
    But what if I want to see anything that was created before I did my MCFC config? For the old purchase orders that is...is there any update program I need to run for the info structure?
    I am a bit new to this so please bare with me...

    Hi,
    Problem has been resolved by passing the 40 char length material, and location in the char combo table of BAPI.
    Ex: CHARACTERISTIC_VALUE = 00000000000000000000000000000000000100600 (Should be 40 char).
          CHAR_COMB_ID = 1 -
    you can give any number.
    Now i am facing another problem with this BAPI.......
    In our planning book time periods like first two weeks in day buckets, after thet all in week buckets.
    Case1: day buckts - noprob
    case2: weekly buckets : suppose a week start from 17/01/2010 end with 23/01/2010. In this case i am not able to create a order on 22/01/2010.
    BAPI allowing the time period start date as 17/01/2011 and end date as 23/01/2011 and its creating the oder on 20/01/2010(middle day of the week).
    Can anybody suggest on this..
    Thanks

  • Saving result from sp_executesql into a variable and using dynamic column name - getting error "Error converting data type varchar to numeric"

    Im getting an error when running a procedure that includes this code.
    I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql
    DECLARE @retval AS DECIMAL(12,2)
    DECLARE @MonthVal VARCHAR(20), @SpreadKeyVal INT
    DECLARE @sqlcmd AS NVARCHAR(150)
    DECLARE @paramdef NVARCHAR(150)
    SET @MonthVal = 'Month' + CAST(@MonthNumber AS VARCHAR(2) );
    SET @SpreadKeyVal = @SpreadKey; --CAST(@SpreadKey AS VARCHAR(10) );
    SET @sqlcmd = N' SELECT @retvalout = @MonthVal FROM dbo.CourseSpread WHERE CourseSpreadId = @SpreadKeyVal';
    SET @paramdef = N'@MonthVal VARCHAR(20), @SpreadKeyVal INT, @retvalout DECIMAL(12,2) OUTPUT'
    --default
    SET @retval = 0.0;
    EXECUTE sys.sp_executesql @sqlcmd,@paramdef, @MonthVal = 'Month4',@SpreadKeyVal = 1, @retvalout = @retval OUTPUT;
    SELECT @retval
    DECLARE @return_value DECIMAL(12,2)
    EXEC @return_value = [dbo].[GetSpreadValueByMonthNumber]
    @SpreadKey = 1,
    @MonthNumber = 4
    SELECT 'Return Value' = @return_value
    Msg 8114, Level 16, State 5, Line 1
    Error converting data type varchar to numeric.

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> I need to select from a dynamic column name and save the result in a variable, but seem to be having trouble with the values being fed to sp_executesql <<
    This is so very, very wrong! A column is an attribute of an entity. The idea that you are so screwed up that you have no idea if you want
    the shoe size, the phone number or something else at run time of this entity. 
    In Software Engineering we have a principle called cohesion that says a model should do one and only one task, have one and only one entry point, and one and only one exit point. 
    Hey, on a scale from 1 to 10, what color is your favorite letter of the alphabet? Yes, your mindset is that level of sillyity and absurdity. 
    Do you know that SQL is a declarative language? This family of languages does not use local variables! 
    Now think about “month_val” and what it means. A month is a temporal unit of measurement, so this is as silly as saying “liter_val” in your code. Why did you use “sp_” on a procedure? It has special meaning in T-SQL.  
    Think about how silly this is: 
     SET @month_val = 'Month' + CAST(@month_nbr AS VARCHAR(2));
    We do not do display formatting in a query. This is a violation of at the tiered architecture principle. We have a presentation layer. But more than that, the INTERVAL temporal data type is a {year-month} and never just a month. This is fundamental. 
    We need to see the DDL so we can re-write this mess. Want to fix it or not?
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Virtual Key figure not getting populated

    Hi All,
    I have included a virtual key figure in a multiprovider  on which the query is created and its underlying ODS.
    This issue is the virtual key figure is not getting populated . I am not sure what I am missing
    I did the following :
    1) Tried Debugging - Put a break point and execute the query in RSRT.It  did not go to the Exit. I also tried  generating the query from RSRT.
    I am using the BADI (RSR_OLAP_BADI) to populate the Vir Key Fig.
    Please guide me.
    Thanks,
    HM

    Hi All,
    Now that I am able to get the logic to come up in debug. I am faced with another issue.
    I am implementing  avery simple logic . I added a integer type key figure to the ODS and I am tryin to assign value 1 to the the key figure in the code (I am assigning 1 just ot check if the value is passed to query or not. I do have acomplex logic tha i need to implement).
    Here I am able ot see the value in the debug but in the qury the value is not populated.
    N ot sure what might be going wrong.
    code is
    l_z_avg = 1.
    <fs_zavglate> = l_z_avg .
    Appreciate help.
    Thanks,
    HM

Maybe you are looking for

  • How to put in Capital letter  a value of a field in Report ?

    Hello, In my report, there is a field that the value is in small letter. Then I want to put it in capital letter always. How must I realize it ? Regardly.

  • Find files in folder doesn't work

    To make my photo galleries, I use CS5, because this is the last version that can use modified galleries that I was able to since CS3.  My modified pages have links to other pages on my web site, while the ones that now come with Photoshop are dead en

  • How can i find out total no of sunday in the year

    Hi Experts, how can i find out total no of sunday's in the particular year. please can any one help how can i do that Regards, Arun

  • Deleted itunes from my computer...?????

    Howdy all Rite deleted itunes the otherday by accident but nw have an empty library How do i import songs from my ipod to the itunes?? Cheers all ipod mini   Windows XP  

  • Switch to "full screen" mode is not working (only sound)

    Hello, When i watch a video from internat sites and switch to full screen mode - i saw the picture for a moment and than "black screen" - by pressing ESC i returen to the site. Can you help ? Thanks, Itzik I use 3000 N200 Notbook running Vista