Query filter over key figure

Hi,
A report need to have a query level filter with key figure (to allow +ve values) but not possible for key figures.
Scenario- every day deltau2019s get added in cube and final report publishes aggregated value. But requirement is to show historical value not the aggregated. This is how cube data looks like-
Ex-
                                        Receipt Date    Profit Center  Amount(Key figure)  ZDAYS (Dimension)   ZDAYCOUNT(Key figure)
First Day Posting            14/09/2009            K                     9800                             1                                          1
2nd days -ve entry         14/09/2009           K                    -9800                             1                                         -1
2nd days actual posting 14/09/2009           K                      6000                             2                                          2
3rd days -ve entry          14/09/2009           K                    -6000                             2                                         -2
3rd days actual posting   14/09/2009          K                     5000                              3                                          3
Now report supposed to show posting values of every day like for Day 1 and Day 2...tried using conditins & other aggregation options but no luck. Does any one has a clue?

Hello,
The only thing i could think of is as below: Check if its plausible.
1) Add a new infoobject ZFLAG (TYPE CHAR, LEN 1) in your cube.
2) Now write a routine to populate values in this object while loading data. The routine is a simple one with below logic:
if KF_value < 0.
ZFLAG = 'N'.
else.
ZFLAG = 'P'.
endif.
3) Now for every -ve value record the ZFLAG will be tagged as N.
4) Now in query filter out all the records with ZFLAG = N.
When you need aggregated report, simply dont use the ZFLAG in the report and the report will show up aggregated values.
Regards,
Shashank

Similar Messages

  • Combine two reports in query designer using key figure with sap exit

    Hi experts,
    i want to combine two reports in query designer using key figure with sap exit
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi Dirk,
    you perhaps know my requirement,
    for the management to make used in one report,
    we have in reporting finacials Ehp3.
    Vendor Due Date Analysis - which show due, not due
    Vendor Overdue Analysis - show only due and analysis in time grid frame
    i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
    krish...

  • Can we filter the Key figure ( by not using Bex Conditions)

    Hello Friends,
    I have a requirement in which I am passing the result of one query "A" to another query "B" ( using replacement path). Also there is a requirement to filter the keyfigure of the query "A"
    Problems I face:
    1) If I use Conditions, it does'nt filter the actual rows from the info cube, but just the query result
    2) Hence when I pass the query result of "A" to query "B", it sends more records which I dont need.
    Question:
    Hence is it possible to filter the keyfigure values at the database level?
    Thanks... Hope some one will guide me.....................

    Hi,
    I've had a similar problem in the past, not specifically for a replacement path but because the number of rows returned by the query was too great to use conditions. In the end what I did was create a characteristic char version of the key figure that was loaded from the same source as the key figure. You then effectively have a key figure that can be filtered in the same way as a normal characteristic.
    Hope this helps.
    Gareth

  • Hard filter on Key Figures

    Hi,
    I am trying to understand an existing report.
    There is just one keyfigure (AMOUNT) in the report and it is put in the hard filter.
    In the Columns, a structure is created with New Selection. This Selection calculates Year To Date and other conditions (but there is no mention of Key Figure).
    In the report Output I get YTD calculation of AMOUNT in the Columns.
    1) I want to know what is the purpose of putting the Key figure in the hard filter.
    2) If we create a New Selection, does it automatically refer to the key figures selected in the Query?

    In General Key Figure is kept in the Filter so that we have an option of creating 2 Characteristics structure which other wise we can have only one KF Structure and one Char Structure.
    And also in such scenarious only one Key Figure is supposed to be kept in Filter. And yes the New Selection created automatically refers to that Key Figure.
    Cheers,
    Neel.

  • Filter by Key Figure or Calculated Key Figure?

    Hi,
    Is it possible to filter a report on key figure or calculated/restricted key figures? If yes, then how?
    Here is an example of my problem:
    I have a restricted key figure for invoice – that picks out the last invoice value between two dates (variable), for instance 2004-01-01 and 2004-12-31. Now, in my query I would like to EXCLUDE materials which don’t have any invoice values between those dates:
    Now:
    Material A 1000 USD
    Material B
    Wanted:
    Material A 1000 USD
    Best Regards
    /Daniel

    Hi Daniel,
    you would use Conditions to achieve this! You can create them in the Bex Query designer.
    Regards,
    michael

  • How to create a crosstab based on BW Query which has key figure structure

    Hi,
    We are on CR 2008 SP1.
    We have an existing BW query with custom Characteristics structure in the "Columns" section and a custom Key Fugure structure in the "Rows" section in the BW query designer.
    Cell editor has been used to define formulas of the cells.
    We wish to build a crystal report on top of the query.
    On the crystal report on top of the query we get the characteristics structure and individual key figure elements. As already discussed in multiple fourm posts, this is the expected behaviour.
    We are using a cross tab and in the column section, I have put the "Characteristic" structure  in the  "columns" section in the crosstab using the crosstab expert. This leads to horizonatal column headings as per expectation.
    Within the characteristics structure we have multiple fields which description "%" with diffeent formula's defined on the BW query designer. On the Cyrtsl Report, when we get the columns in the crosstab, we get only a single "%" field. All other "%" fields are not visible.
    A. Is there a way to get all fields in in case of same description?
    I tried putting in the Key Figure elements in the "Rows" section, but was not able to get desired output.
    Experts: Can you advice how this report can be built?
    Any help will be appretiated.
    Rgds

    I am interested... How did you solve it?

  • Query Designer restricted key figures using a prompt value

    Hallo Experts,
    I would like to restrict key figures after user has beeen prompted to enter a date. I have 2 key figures:
    a) KF1, Date1
    b) KF2, Date2
    User should be prompted to select a specific date: e.g. 01/2011. After selecting/entering the prompted date value, it should be given to date objects for intance Date1=01/2011 and Date2=01/2011.
    How could I achieve it in Query Designer without using customer_exit function? Reason is that non-experienced users will use this report and they should not be confronted with complex query. Do you have any idea?  
    Many thanks
    Mamadu

    Hi,
    I assume that you need to restrict the value of keyfigures by date based on user input data on variable selection screen.
    First create one user input variable on your date field say for eg calday.
    Now restrict your KF1 with calday and choose that vairable which you created.
    For second KF2 which seems to me need to be restricted with offset of +1 based on the date entered by the user.
    So restrict this KF2 with calday and use the same variable with offset of +1
    I just misunderstood you ned calmonth or day because in requirement you have given month but you are calling it as date.
    If its month then replace calday with calmonth..
    Hope it helps.
    Regards,
    AL:
    Edited by: AL1112 on Dec 21, 2011 9:42 AM

  • BEx Query-Problem opening query showing restricted key figure is inactive

    Hi  all,
    While activating the Query we are getting error , the object is missing in active version  ?
    And also it is not allowing to open the query  how  to activate the query element now?
    Also restricted key figure is inactive and how to activate the query in background ?

    Hi,
    I have never heard of query activation, we simply create the query and save it. I don't know which activity you are referring to but try to open your query through RSRT and check what is the error it shows?
    And before that make sure that your Infoprovider is in active state.
    Regards,
    Durgesh.

  • Query designer execute the query some of key figure showing as * value

    Hello All,
    I am executing the query from Query designer, executed in web in Mozilla Firefox browser some of key figures values were showing as * value.
    same query i run through RSRT its showing value for example: value is 615574389.260
    if the value is more then web cannot display the result? how to correct it, Thanks!
    Regards,
    Ranga
    Edited by: Ranga123 on Jan 30, 2012 6:09 PM

    Hi Ranga,
    Does your Key Figure also have unit? Usually we get  * when records with different units are aggregated. As you cannot add 1 EURO to 1$, * is displayed.
    Regards,
    Nikhil

  • BEx query: count unique key figure values

    Hi
    I need a little help with a query. I need to count the number of unique key figure values. Se example;
    Data:
    Employee1 - 2
    Employee2 - 3
    Employee3 - 2
    Employee4 - 1
    Employee5 - 2
    Employee6 - 1
    Employee7 - 2
    Wanted output:
    1 - 2
    2 - 4
    3 - 1
    What kind of options do I have?
    Thanks
    Mike

    I would create a new characterstic for the same key figure and placed in rows and count in columns.
    and second approach would be , create condition with customer exit and write the logic to count the unique values.
    This is just a direction to move forward with the assumption that you are good in using variables and wirting logic in ABAP.
    Thanks,
    Sukhi

  • Add a comment to a query cell (Characteristic / Key Figure Combination)

    Hi Gurus
    Essentially we are attempting to allow users add a comment to a number they enter in an IP planning screen. 
    The issue we have is that when we add the comment using the standard right click functionality it is stored against the basic key figure, not the characteristic/key figure combination.  This means that the same comment will appear everywhere that key figure is used.
    Is there a way to make comments specific to characteristic/key figure combinations so that they would show against only that cell?
    Thanks
    Gareth

    Hello,
    have you tried the GRID reporting. if the structure of your report is fix you can use a formular for each cell.
    In we reporting you have the possibility to change the output of the report with the web table interface (user exit)
    I have no other idea.
    reg.
    Michael

  • Filter query on Key Figures

    How can I filter a query based on Key Figures? When I use conditions, the results totals don't change. I need the results to reflect the filtered data.

    Angie,
    There is no standard functionality to achieve this, but you can do it using formulas.
    To check the problem:
    E.g. You have
    Material  Qty  Value
    A           1      100
    B           2      300
    C           4      1000
    Result    7      1400
    You want to be able to filter out Materials with Qty less than 2 so you are left with just Materials B and C and the result shows Qty 6, Value 1300.
    Create a formula, say 'QtyH'.
    The formula detail should be: Qty > 1
    This formula will display 1 for Materials B and C, Zero for Material A.
    Create a second formula, say 'Qty Filtered'.
    Formula detail needs to be QtyH * Qty.
    Change Calculations tab to Calculate Results as Total.
    This formula will display Zero for Material A, 2 for B and 4 for C.
    Result row will show 6.
    Repeat for the Value KF.
    To simplify this you can actually combine the logic in 'QtyH' and 'Qty Filtered' into one Formula. See SAP Help under Defining New Queries; Defining Formulas, Boolean Operators
    Also, if instead of QtyH being Qty > 1, you use a Formula Variable, you can give users the option to specify what filter level they want.
    E.g. Qty > 'MyFormulaVariable' where the formula variable is created as Manual Input/Default Value.
    Hope this helps!

  • Sorting a Key Figure by default in a query

    Hi,
    I'm trying to set up a query with a key figure that is sorted in descending order by default everytime.  I tried creating the following condition:
    Key Figure - Sales Volume
    Operator - Top %
    Values - 100
    This sorts the key figure in descending order to a point.  When I add a characteristic to the report (for example, sold to), the sorting is no longer active.  I would like this key figure to remain sorted in descending order regardless of the any manipulation to the report.  But, I'd still like the user to have the ability to change the sorting if they want to sort by another key figure (ascending or descending)
    I'm using the BI 7.0 Query Designer.
    Thanks!!

    Check this:
    Sort Key Figures and Maximum query result
    Organising key figures in BEx Query Designer
    ordering display in a KF
    Hope it helps..

  • Change Order of key figures

    Hi Gurus,
    We are using BI 7.0. & MS excel 2003 & 2007 both.
    I've designed a query with 10 Key figures.
    After execution, based on Key figures I have Added Local Formula in query.
    Now I want to change the order of Key Figures and bring Newly added Local Formula column at 3rd position.
    I've tried using Select Filter... and changed the order of column as I want, but this doesn't work.
    I can drag the column & drop it at desired position. It's working that way in office 2003.
    But in office 2007, Drag and Drop not working at all. Even for characteristics also.
    Is this problem with BEx Excel Patch? I've installed excel patch for both 2003 & 2007. But still not working properly.
    Please suggest. If you know latest patch available for office 2003 & 2007, please suggest.
    Thanks.

    HI,
    I am on BI7, Excel 2007
    Drag and Drop Functionality for both Char & KF is working fine including the placement of Local Formula.
    seems you need to check with the Basis Team for proper installation of the BEx Excel patch
    Regards
    ReddY A

  • Non cumulative key figures

    Hi
    I understand that there are 3 types of non cumulative key figues with these optiones.
    1) cumulative KF with exception aggregation
    2) with associated single delta(cumulative)
    3)with associated IN and Outflow(cumulative)
    I know that we use type 3 in inventory. Has any one used option 2 with Non cumulative KF with associated single Delta?
    Please let me know the scenario where it is useful?
    Thanks
    Vennela

    Vennela,
    It all boils down to the definition of what cumulation is ...
    cumulation refers to straightforward addition of key figures along given filter conditions in the query. This is similar to the sum() operator in an SQL query.
    However people will need different kind of aggregation at different points in time other than the standard aggregation / cumulation that is used regularly.
    Coming to non cumulation :
    1) cumulative KF with exception aggregation
    This refers to predominantly formulae - for instance - count of all customers whose sales > 0 - but the report is does not have customer in it and the result is expected. This would mean that the calculation essentially happens at a different level as opposed to the actual query and the key figure cannot be simply summed up.
    2) with associated single delta(cumulative)
    This is somewhat at a higher level of granularity as opposed to case 3 where you look at all movements. An example here would be You have opening stock and then you get only the debits and credits for the day as opposed to getting stock for all movement types.
    Somethign like
    opening Stock for the day = 100
    Outgoing stock = 30
    incoming stock = 10
    Here movment type information is omitted and instead is consolidated in the source system itself.
    3)with associated IN and Outflow(cumulative)
    This has been discussed many a time and can be found by searching the forums...

Maybe you are looking for