Query Design Logic

Hi Experts,
Here is My Requirement.(Trend analysis Report)
The objective of the report is to analyze trend of certain key figures at family / class/ brick level for previous 3 / 6 / 9 / 12 (each indivivdual reports) months on the basis of geographical hierarchy. It will display the results of key figures for the time period chosen in the input date range. Depending on the type of report generated (3 month, 6 month, 9 month, 12 month), the report will also output the same set of key figures, for the same number of days as in the chosen date range, but at a historical level.
KF's are Net Value, stock outs,  etc
Can you give me the logic.
Advance Thanks,
Suresh.

Hi
  Let us take u want to show the data of key figure "X" for this monht, previous month and the data for 2 months before, what  you have to do is
1.) restrict ur KF "X" with the time characteristic(0calmonth or 0fiscper of ur cusom defined object) and this time char should be user defined value (manual entry variable) to get the value for the month whatever the user enters.
2.) to get the value for previous month do the same thing what i said above and take offset "1" on ur time char;
3.) to get value for 2 months before data do same thing what i said above and take offset "2"
Like this u can get data for whatever month u want.*
Hope u understand
Regards
Prasad

Similar Messages

  • Formula Logic for Dates in the Cell Editor in Query Designer

    Hi All
    We are on BI7. (This is in the Cell Editor in Query Designer)
    I am trying to create a formula in one cell that enters a date based on the following logic (Lets call this formula A):
    I also have a placeholder "Cell reference" for a Date in another cell in the Cell Editor (Lets call it B).
    I also have two other dates in seperate cells in the Editor (Lets call them C and D)
    What i need to do is check that either C or D are not blank i.e one at least has a date and if so enter the date that is in B in A.
    My formula logic in (Cell A) at the moment is as follows:
    ( Cell C <> 0 ) OR ( Cell D <> 0) * Cell B
    When I run the query It is coming back with either a 1 or  0 depending if there is a date in C or D.
    What I want it to do is to display the actual date of  'Cell B'  in 'Cell A' if  ( Cell C <> 0 ) OR ( Cell D <> 0)
    If the value of B is blank ie no date I also want A to be blank i.e not equal zero or a blank date ie 00/00/0000
    Example 1
    Cell A    08/09/2009
    Cell B    08/09/2009
    Cell C   15/03/2010
    Cell D
    Cell A should = 08/09/2009 as there is a Date in Cell C or D and if so enter the date of Cell B in cell A
    Example 2
    Cell A   
    Cell B    08/09/2009
    Cell C  
    Cell D
    Cell A should = BLANK as there is a NO Date in Cell C or D
    Example 3
    Cell A   
    Cell B  
    Cell C   15/03/2010
    Cell D
    Cell A should = BLANK as there is a No Date in Cell B although a Date in cell C or D.
    Thank you for assistance in advance
    Kind regards
    Stevo

    Hi there,
    It seems you have done almost everything...
    What it seems that is missing is probably the cell reference for Cell C and for Cell D, or did you forget to mention it here?
    So here it is the big idea:
    - In the Cell Editor of the query designer, create a new cell reference for Cell C, let's name it ref_cell_c;
    - In the Cell Editor of the query designer, create a new cell reference for Cell D, let's name it ref_cell_d;
    - In the Cell Editor of the query designer, create a new cell reference for Cell B, let's name it ref_cell_b;
    - In the Cell Editor of the query designer, create a new formula for Cell A, let's name it form_cell_a;
    The form_cell_a should be created by the following:
    ( COUNT(ref_cell_c) + COUNT(ref_cell_d) ) * ref_cell_b
    So COUNT(operand) returns 1 if operand is different of 0 else it returns 0; So if ref_cell_c has any valu or ref_cell_d has any value it should return the value of ref_cell_b.
    Please note that with this formula, if you have values in both ref_cell_c and ref_cell_d this formula returns 2 * ref_cell_b, which is not what you pretend, I'm assuming you'll have value only for the following combinations:
    ref_cell_c has value but ref_cell_d don't have any
    ref_cell_c don't have any value but ref_cell_d has a value
    ref_cell_c don't have any value neighther has ref_cell_d any
    Diogo.

  • Query Designer Formula Logic

    Hi
    I have the following data and the status of the formula should be 1 or 0.
    Cancel Date : 05/31/2011
    Formula  : cancel date >=today's date                             
    Cancelled(Yes =1/No= 0) : 1
    Cancel Date : # (no date assigned)
    Formula  : cancel date >=today's date                             
    Cancelled(Yes =1/No= 0) : 0
    Cancel Date : 06/30/2011
    Formula  : cancel date >=today's date                             
    Cancelled(Yes =1/No= 0) : 0
    i tried the following formula in the query designer 7.0 but second condition gives 1 instead of 0.
    DELTA ( COUNT (cancel date >= today's date)).
    I am not able to find a better solution, please suggest.
    Thanks!
    Edited by: bwcrm01 on Jun 1, 2011 6:28 AM

    Hi,
    Here todays date is 06/01/2011 right? Shouldnt then be 1, 0 other way round for 1 &3.
    Cancel Date : 05/31/2011
    Formula : cancel date >=today's date
    Cancelled(Yes =1/No= 0) : 0
    Cancel Date : 06/30/2011
    Formula : cancel date >=today's date
    Cancelled(Yes =1/No= 0) : 1
    Anyways, Cancel Date is present as a Characteristic or KF? If Char, you can create the RKF, add above CKF in a RKF with Cancel Date NE #. This will give 'Blank' not zero when Cancel date = #.

  • Where to write IF THEN ELASE statements in BEX Query Designer

    Hi All,
    I need to write a formula in query designer...
    saying that to display the all Quantities in KGs.. Now articles are in Grams and KGs...
    So here i need to perform calculation like... if article is in KGs divide by 1, else if article is in Grams divide by 1000.
    where can i write this logic to perform calculation ...
    Thanks in advance..
    ravi.p

    hi chetan,
    No its not work.. why because i  need to convert the unit of measure in Masterdata Attribute values... that means ) ' 0grooss_wt'.  this is  attribute as a keyfigure of ' 0material' .. this ' 0gross_wt' values has to convert in KGs. at Present ' 0gross_wt' values are in KG and Grams...
    I can change these values in update rules by writting  Routine.. But I need to convert it in KGS at BEX Query Designer Level..
    I need calculate like this
    quantity sold * Gross Weight. 
    here Gross Weight is the formula variable which replacing the values of gross weight...
    i tried by creating conversion types in RSUOM t-code. but it works on keyfigures of infocube.. not on attribute values of master data...
    is there any solution to solve this Problem...

  • Difference between  aggregation and calculation tab in BEx Query Designer

    HI,
    I am using BEx Query Designer for my report, for the key figures in the coloumn area i slected one numeric key figures, in  the properties tab i found aggregation tab and calculation tab.
    I need to sum up the total values for that particualar coloumn, when i used calculation tab i found to sum all the values for a particular coloumn, then what is the use the aggreagation tab?
    I not able to used that Aggregation tab it is showing as a hidden fields...
    can any one tell me whats the exact difference between these tabs and when we need to use which tab?
    With Regards,
    Thanesh Kumar.

    Hi Thanesh Kumar,
    I moved this thread from forum Data Warehousing to Business Explorer since it is a query related question (as SDN moderator).
    I could explain to you the difference between these two tabs.
    For "calculation" tab, it changes the display of result and does not change the calculation logic.
    It means that, if this key figure is used further in formula, still the original number (without "calculation" tab setting)  is used for further formula calculation.
    For "aggregation" tab, it changes the real calculation logic.
    The system takes the setting as the aggregation rule for records.
    The most common aggregation rule is of course summation. If you set to e.g. Average here, the system does the
    Average instead of summation when aggregating records. And the Average value will be taken for calculation
    in further formulas or other calculations.
    For "aggregation" tab, you could only use it for CKF (calculated key figure) or formula and you could not use it for
    a basic key figure. That should be the reason why you see it greyed-out.
    Regards,
    Patricia

  • IF...ELSE.. STATEMENT in BEx Query Designer

    Hi,
    Why there is no IF, ELSE function in BEx Query Designer?
    Assuming I need to write the following logic, how can it be accomplished?
    IF (A=0 OR B=0)
        THEN 0
    ELSE IF ( B/A <0)
        THEN '       *'
    ELSE
        B/A * 100
    i.e.
    if A or B is equal to 0, then display the value of 0
    else if B is negative (as A is either 0 or positive), then display the following text: '         *'
    otherwise, display the value of  B/A * 100
    Thanks!

    Hi,
    You can achieve this by creating a new formula.
    You have to use the boolean operations and mathematical functions. But we cannot display *. u have to display some value for that.
    Khaja

  • Need Help: Query Designer

    Hi experts,
    In Query designer, is it possible to create an IF statement for "IRRATIONAL NUMBERS"?
    Lets say 10.03, 1.26, 3.1 and so on...
    The statement would be as follow:
    If Val1==N.x then 0 else Val1.
    To summary, if the value is N.x (N for rational numbers 1,2,3,... and .x for decimal values like .23, .44, .01 and so on...),
    then the value N.x will be changed or converted into "0".
    Example: If the value of FieldA on the report is 10.3, it then should be converted into Zero "0".
    another is if value is 1.03, then the report should show 0 instead of 1.03
    I arrived to a solution wherein I have to create three logic expression.
    First is to convert first the Irrational Number into Zero "0".
    Second is to create new selection in KF wherein it will pull the data containing the converted "N.x to Zero".
    And third is to create the IF statement logic that will satisfy my expected value.
    I'm having this problem on the first one as I have no idea how to convert irrational number into zero "0" value.
    the second and the last part would be fine as my main problem here is how can I convert the irrational number in to zero?
    Any suggestions?

    Hi,
    Please try the below.. Hope this will solve your issue
    Eg. of data
    Dist. Channel  -
    Value
    Dom1----100.5
    exp1----200.4
    dom2---50
    exp2---75
    Expected out put
    Dist. Channel  -
    Value
    Dom1----0
    exp1----0
    dom2---50
    exp2---75
    Steps1
    Drag and drop Dist.Channel in row and value in colum
    create a formula1 using ur kf value 
          CEIL(value)    --- which will provide us integior part with out decimal
    Steps2
    create another fomula2
    using boolean operator compare the value
    (formula2==value)*value
    this formula compare our two values and will produce a boolean value ie 1 or 0
        :  Eg 100.5  ceil(100.5) = 100  Now in our formula1 we are comparing these two values are equal or not ie 100.5 - 100 so out come will be 0 then 0100.5 = 0 always if our condition is true then 1100 = 100
    Related Links :
    Boolean Operator
    http://help.sap.com/saphelp_nw04/helpdata/EN/71/0aec3b6e011341e10000000a114084/frameset.htm
    Thanks
    BVR

  • Can Power Users or Mgt Create and Design Reports Through Query Designer ?

    Dear BI consultants,
    Iam new to BI.
    My management has requested me to Train Power users from All Modules(FICO,HR,QM,PP,SD,MM) to Create Queries and Design Through Query Designer.
    My question is are we suppose to Give query Designer Access to Power users or Mgt so that they can create Queries and reports by themselves.Please Suggest me wht is the Best Practices.
    is it feasable to train power users and Mgt as to how 2 create queries. will there be any side effect on the System or our end.
    Plz suggest.
    wht are the advantages and disadvantages of this.
    If I train the Power users then is there any risk of my Job.
    since they will be creating all reports by themselves.
    wht else can a BI consultant do since iam in a support project.
    how do i convince my Mgt?
    Plz Suggest.
    Thanks Awaiting

    This is common procedure maintained in most of the company's for end users.
    There is no issue if you train the power users.you will be the first point of contact if they have any doubts.and more over you are supporting for your client right? this can't be handed over to power user or end user. data is imp for the client so there will not be any problem for you, if any issue comes while loading you need to take care of the errors and fix the.
    power users or end user will be familiar with Business requirement not with the Query building logic's not with the BW procedure so no worries for you.
    as vineeth said its better to keep control regarding the global and key things at your end so that you will not loose contol on the reports.

  • Using Boolen Operations in Query Designer

    Hi All,
    Below are the new formula which i have created in query designer
    1.Number of years of service
    2.Gratuity if years of service is greater than 20.
    3.Gratuity if years of service is lessthan 20.
    Now in report output i need to display Gratuity if years of service is greater than 20, or Gratuity if years of service is lessthan 20 based on Number of years of service.
    In boolen function i have done as below
    Number of years of service>=20==Gratuity if years of service is greater than 20
    But in report output iam getting zero(0).
    Is there any other way pls let me know
    Regards
    Albaik

    HI Pravinder,
    Number of years of service>=20=Gratuity
    so how do we display this.
    what does * indicate and where do we find this
    (Number of years of service>=20) * Gratuity
    Please let me know in detail
    where do we find IF<Logic Expression IS IT IN BOOLEN OPERATION or MATHEMATICAL FUNCTION
    In BEx you can follow this while writing a formula:
    Follow this
    IF<Logic Expression> THEN <Expression1> ELSE <Expression2>
    this expression can be made using a formula in the form
    <Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>
    Please helpme
    Regards
    Albaik

  • BEx query design: defining complex filters?

    Is it possible to define complex filters in a query definition? By complex I mean using logical operators (AND, OR, NOT)
    Example: report giving sales results
    I want to have
    (Customers from Germany <b> AND </b> product type A)
    <b> OR </b>
    (Customers from Romania <b> AND </b> product type B)
    If I define a standard filter:
    Customer country IN (DE,RO)
    Product type IN (A,B)
    I will obtain all combinations while I only want to have the couples {(DE,A),(RO,B)}.
    Thxs.
    LauQ

    Hide is just to remove the "object" from the display. It is used as an intermediate filter for the object that includes the logical combinations that one would like to get in the results.
    In my example:
    In the Query Designer:
    1. Define a structure (rows)
    2. right-click on it and make new selections corresponding with
    a) Country=Germany (:='DE')
    b) Country=Romania (:='RO')
    c) Material=A
    d) Material=B
    3. Right-click on each of them and "hide" them
    4. New formula in the structure:
    TEST:=(( 'DE' AND 'A' ) OR ( 'RO' AND 'B' ) )
    5. You need to edit the Cell definition and make use of the Help Cells (select therein the KF you need to display; e.g. "QUANTITY SOLD").
    6. "Play" with Cell definition and define a final KF such as:
    FINAL:='QUANTITY SOLD' * 'HELP'
    You need to try by yourself...
    Regards
    LauQ

  • About variables in query designer

    what is the difference between replacement path and cmod in query designer?
    illustrate with an example?
    Regards,
    Bhavya K

    Hi,
    Replacement path:
    When you create a variable ,if you want the variable to be replaced with the value from an info object/another variable /Query/Hierarchy  then we select Replacement path
    CMOD:
    If the values for the variable are to be collected based on the ABAP logic written for the variable in CMOD then we go for CMOD selection.
    Refer the links for examples:
    http://www.sapks.com/2010/04/replacement-path-in-variable-reporting.html
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/78a03c1178ad2ce10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/03/6ba03cc24efd1de10000000a114084/content.htm
    Refer to this link for scenarios on Cmod from Mr.Surendar reddy
    http://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    @ Sri
    Edited by: Sri kamesh on Mar 2, 2012 7:30 PM

  • BEx Query Designer - Execute pops up blank Internet Explorer session

    Hi gurus,
    From BEx Query Designer, I choose Execute, and it pops up a blank Internet Explorer window rather than the query.  It says about:blank in the URL and the page is white.
    I read some posts that say to run RSPOR_SETUP, but I don't have a Java system or Portal system so does that still apply to me?  I want the URL that pops up to point to the BW system which is an ABAP system.
    E_URL_PREFIX                    http://BWSAPF00.mydomain.com:8100
    E_URL_PATH                      /sap/bw/BEx
    E_URL_PROTOCOL                  http
    E_URL_SERVER                    BWSAPF00.mydomain.com
    E_URL_PORT                      8100
    E_SUBRC                         0
    Warm Regards,
    CM

    Hi,
    Please note that Java stack is mandatory for running Queries in web side
    or for executing the Queries using Transaction RSRT -> Java Web or
    for executing the Queries using Query Designer in Release 7.x .
    So, please install Java stack and use BI Java components for running
    Queries in web side here.
    Also, please refer the following note for details:
    917950 - SAP NetWeaver 2004s: Setting Up BEx Web
    Also keep a note of the following:
    Please check the following link:
    http://help.sap.com/saphelp_nwpi71
    /helpdata/en/45/61d5aaa0546628e10000000a1553f6/frameset.htm
    "With SAP NetWeaver 7.1, the Visual Administrator (VA) is replaced by
    the SAP NetWeaver Administrator, that is, all relevant functions of
    the VA are available in the SAP NetWeaver Administrator.
    The VA is no longer delivered as of SAP NetWeaver 7.1.  "
    The interface is a little bit different now, but the installation
    steps still follow the same logic as SAP NetWeaver 2004s.
    You can use manual steps to set up integration as per note 917950.
    Also, please don´t use report RSPOR_SETUP for configuration check
    between ABAP and Java for SAP NetWeaver 2004s.
    The report has been replaced by the support desk tool.
    Please have a look at note '937697 - Usage of
    SAP NetWeaver BI Diagnostics & Support Desk Tool'
    RSPOR_SETUP is obsolete in BI 7.x release and Supportdesk tool should
    be used in 7.x release.
    Also refer the following notes:
    1512988 - Frequently Asked Questions:BI Java 7.30 SP's/patches
    1512356 - Patches for NetWeaver 7.30  BI Java Support Package
    1506722 - Generic Note for BI Java Patches and Support Packages
    And, please note that Patch Level 0 is not supported for  BI Java components as per the following note:
    1789842 - Patch Level 0 for BI Java Installation
    Please do look at the note 1789842 for details.
    Please check the Support Desk Tool as per the note 937697 and if you find
    any RED signals in the file systeminfo.txt included in the file
    supportdesk.zip, please correct it as per the Solution mentioned
    there and check if it helps.
    Thanks & Regards,
    Sapna
    Message was edited by: Sapna J Gurudutt

  • Bex Query Designer not using default browser

    hello all, i have disabled my Internet Explorer from being my default browser, however, when i use the Bex query designer and test, it initiates my Internet Explorer, and not my default Safari browser.
    does anyone know where this setting is made ?
    thanks
    g

    Skype uses IE ("Internet Explorer") as the browser interface on Windows based systems, this currently includes many windows such as the logon screen and add Contacts screen. This is fairly normal when a program uses browser logic internally, it is not changing what you use as a default browser.
    About Me You can also use a IP Camera as your camera for Skype video Example Instructions

  • Best practise BW Query design for Crystal Reports integration

    Hi all,
    I am looking for a guide on best practices when designing a BW Query to be used as data foundation for a Crystal Report.
    The scenario is that I am responsible for developing the Crystal Reports part, but not the BW Query part, therefore I would like to provide a list of best practises to the person who is responsible for the Query, this way make sure that the integration will work as good as possible. The setup is of course using BO Integration Kit for SAP.
    An example is how to use authorization variables in the query to provide data security. This is just one example, there are problably a number of other things to be aware of. A document containing suggestions for best practices is what I am looking for, or if the document does not exist, input to what should be on such a list.
    Thank you in advance.
    Regards,
    Rasmus

    Hi Rasmus,
    in regards to the Best Practices for Crystal Reports you can leverage all the knowledge you have on the Query Design today already. if you not the person for designing the query I think it is important to make sure people designing the queries do understand how Crystal Reports is leveraging the elements from the BI Query.
    /people/ingo.hilgefort/blog/2008/02/19/businessobjects-and-sap-part-2
    You should try to put as much as possible into the BI query from the logic point of view.
    and you can also build common BI queries - there is no need to build a BI query for each report.
    ingo

  • Assigning System variables in query designer

    Hi all,
    My requirement is that For a field CALENDAR DAY, i Want to set the default values so that it displays the data for last seven days from the current system date by using sy-datum. This should be done without using customer exit logic.Can anyone tel me how can this be done in Bex query designer.

    Hi Imanik,
    I think using custom exit to arrive to a solution of your issue is the most efficient way as of now.
    Alternatively you can write a routine in ETL Where in you can check if  Sy-Datum - 7 <= Calday, then you can have a field Flag in Infoprovider which would be populated by X in this case. Later on in Bex you can have a filter on Calday  = X. But this scenario works only when you are doing:
    1. A full load.
    2. You are running the query on the same day you are doing this full load.
    Regards
    Raj

Maybe you are looking for

  • Search not working as expected for list

    We're running SP 2013 Ent on-prem. I have a user whose added several text columns to a list an when he performs a search for data in those fields, it returns nothing. It's very inconsistent, some rows will return if you search on them, but others wil

  • How to Get the Source File Path in the Receiver Side

    Hi Experts, Here We are Trying to Do How to Get the Sender Information ( File Name & Path ) on the Receiver Side . According to the Michal Blog /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp

  • I want to correct only part of my image. What tools do I use?

    CORRECTING PART OF YOUR PHOTO – USING SELECTIONS When you want to modify or adjust a specific area of a photo or image, you need to make a selection first. Once an area is selected you can use Photoshop image adjustment tools. This video covers  the

  • Best practices for Flash CS5 and Flash Builder 4 integration?

    With Flash CS5's new XFL file structure/format, what's the best way to structure project files for Flash CS5 integration with Flash Builder 4? Flash CS5 autocreates a folder named after the xfl file as the outer container, and then all the assets/xfl

  • Pacman -S usb_modeswitch URL returned error: 404

    Hi, I have a raspberrypi board with archlinux I'm trying to install usb_modeswitch with no success [root@alarmpi ~]# pacman -Ss usb_modeswitch community/usb_modeswitch 1.2.3-1     Activating switchable USB devices on Linux. First search for package o