Variable in Query

Hi
In one of my query I want to calulate the values based on price in material master (standard price & moving average price). I am getting these values in query using replacement path variables. Problem is that user want a selection for this price. If the user select std. price report should work on that otherwise it will be on moving average price.
How can I create a variable like that and get it calculated in a single query? If anybody have some idea pls reply.
Thanks
EV

Hi:
WHy don't use both of them and compute 2 different Cal Key -Figures all the time and users can pick whatever they want becasie they have both.
Apart from this, nothing is coming to my mind yet, but I will kepp you posted if I get another plan.
Ram C.

Similar Messages

  • How to assign current date/time to a formula variable in Query Designer

    How do I assign the current date to a formula variable in Query Designer? I need to use current data in a calculation and just need the date the report was run.
    Thanks

    Hi Philip,
    There is an SAP formula variable to supply the current date in a formula. I think it is 0F_ADAY...install it from business content if you cannot see it in the query designer (formula box, under formula variables) and try using it.
    Hope this helps...

  • Can we create range variable for Query Key Date

    Hello Gurus,
    Can we create a range variable for Query Key Date ? when I tried to give a range of values for Query Key Date, I am unable to find Range Values option. I found only Single Values.
    so, Please let me know if we can use Range variables for Query Key Date ??
    Thanks in advance,
    Regards,
    Aarthi

    Hi Aarthi,
    This is relevant for the time dependant master data that is being pulled in thw query. Like if you are using a nav attr in the query and this nav attr is time dependant, then which record (from the char master data) is to be pulled into the report, depends upon the key date that you specify.
    The default key date value is the date on which the query is executed, that is <Today>.
    Hope this helps...

  • Variable for Query without changing Datamodel

    Hello Experts,
    I need in the Query a variable, which should have inpact on the processing in the user-exit. This variable should no be used directly for constraining data.
    It is an Yes/No variable. And I don't have in my multicube any characteristic which have Yes/No in their domain.
    In such situation I have always added to Multiprovider and Cube an new characteristic and created an variable for this characteristic.
    But I don't like this solution, because this changes in the datamodel are in really not important for the datamodel. It only an work around for getting the possibility of adding a variable.
    Does someone know an better idea for adding variables to query, without changing datamodel like this.
    Thanks
    Wojciech

    Hi Bhanu,
    Not really - I don't want to change Cubes.
    Thanks
    Wojciech

  • Fox Formula Variable In Query Designer

    Hi Experts,
    I have created 1 variable in fox formula of type VARV and i want this Variable to show in query designer while creating new Variable so that i can replace the Query Variable With Fox Formula by Using Replacement Path.
    While Creating new variable in Query Designer it is not Showing that Fox Formula variable.
    Because i want to use this in WAD While Executing the Planning Sequence.
    Is there any way we could get That Fox Formula variable in Query Designer.
    Regards
    Girish

    Hi Marc,
    While Creating Variable from Query Using Query Properties it is still not Showing That Variable in Fox Formula.
    And My Requirement was to Replace that Fox Formula Variable With Query Designer Variable.
    Please Suggest any Solution.
    Thanks
    Girish

  • Can't subtotal on measure variables from Query 2 in merge dimension report

    I use a query identifying customers (Query1.HH_ID) sold by each salesperson. A second query identifies a subset of those customers who are longtime customers. I merge these queries using the dimension, HH_ID. I project Query1.HH_ID onto the report and create a variable via =If([Query2].[HH_count]=1;1;0) to get a measure which is either 1 or 0 depending on whether a record is retrieved from Query2 with a value for Query2.HH_ID that matches Query1.HH_ID. The report is fine at the detail level, but when I insert a break and try to subtotal the measures, the variable from Query 2 produces a subtotal of 0 even though I can see a mixture of detail records with 1s and 0s. It appears that one cannot subtotal on measures from Query2 in a merged dimension report, or at least not if the merged dimension is not projected onto the report but rather only the dimension from Query1. Is this a known principle?

    Hi Michael,
    I think the issue is that they Query2.HH_Count is being summed first. So if you have a mixture of values, say
    rownumber, value
    1,1
    2,0
    3,1,
    4,0
    you will get 0 as your HH_count will equal 2.
    Try
    =If(Query2.HH_count>=1;1;0)
    Alternatively try
    =If(Average(Query2.HH_count)=1;1;0)
    Hope this helps
    Alan

  • 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

  • Unable to see the variable in Query Designer

    Hello Experts,
    I am running one report and it is showing me 0calday variable selection screen at run time. I am unable to see this Variable on my Query designer but when I am opening query properties its showing me in this.
    Kindly let me know where is this Variable using in my query designer ?
    Thanks,
    Anoop

    Hi Anoop,
    The variable is probably being used to restrict a key figure.
    Go to the key figures,
    Display the technical names
    Check the key figures for which the technical name is not appearing even though the key figure is not a formula.
    Here you will see one of the key figure being restricted by a variable for 0calday
    Hope this helps.
    Regards,
    Joe
    Didnt notice the question is answered :P
    Edited by: lazarus_joey on Feb 17, 2012 6:48 PM

  • Customer Exit variable of Query not working in View

    Hi,
    I have a customer exit variable in my query to calculate the last 6 month period on Calendar month. I have used 0CMONTH for the same and then using offset of 6 on its value range to get it.
    Now, I have many views based on this query, which should ideally be having the same filter condition for the calendar month, but it is not happening. Although, it is working fine for the query! The views do not seem to be catching the selection correct.

    Hi there,
    As far as I Know, yes they exist. The only difference here, is that you build a query with a selection screen, and  you execute the query with some selection parameters, and therefore all customer exit variables, offsets, etc, will be read and changed at the runtime execution of the query, and you can rearrange your query visualization drilling down free char., making filters, etc. and storing that visualization in a view.
    If you save your view and execute it afterwards, you'll get the same selection parameters to input, the same offsets, etc, that you have with the query, but with a visualization stored by you.
    So that should have been working.
    Diogo.

  • SAP BI - OLAP variable in DTP unable to read from input ready variable in query

    Hello,
    Here's the problem:
    We have a process chain which is launched in a WAD.
    We would like to filter the DTPs in the PC with the values entered in the variable screen of the WAD
    I created a variable of type customer exit X which reads the input ready variable Y in CMOD.
    Customer exit variable X was placed in the filter of the DTP.
    The input ready variable Y in the query contained in the WAD.
    I am getting an error that customer exit variable X is getting not value.
    Is it possible to read an input ready variable in a customer exit variable placed in a DTP?
    Or am I missing a step here?
    Please help.
    Thanks in advance

    Hi Anjalee,
    Maybe it would be good to share a bit more information on your scenario and the chosen solution design. I am currently missing the point of triggering a Process Chain using Web Application Designer.
    Anyway, I recommend to be careful with using OLAP variables in DTP filters. For sure not all functionality is present, e.g. because the variable pop-up is absent. Your constellation of an input ready variable and a customer-exit variable will only work in the context of a BEx Query and probably not if used in a DTP filter.
    Best regards,
    Sander

  • How to get value in variable from query in PLD / ALD

    Hi, everyone,
    I want to retrieve value from database via query in PLD/ALD variable on basic of PLD / ALD variable's content. is it possible ?

    Hi
    Try this,
    ->> Open the GRPO document.
    ->> Click the Tools on menu bar and Open the Form Setting widnow.
    ->> put the tick mark in BaseRef, BaseDoc, TrgetDoc
    i think, Base Document no field default in SAP B1.
    try to search the Base doc. Date in row level on GRPO document.
    Try to Create UDF & FMS then assign the FMS in UDF
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry
    WHERE
    T1.[DocNum]=$[PDN1.BaseRef]
    OR
    SELECT Distinct T1.DocDate
    FROM PDN1 T0 INNER JOIN POR1 T1
             ON T0.BaseEntry=T1.DocEntry and
                T0.BaseLine=T1.LineNum and T0.BaseType=22
    WHERE T0.[BaseType] =22
       and T1.[DocNum]=$[PDN1.BaseRef]
    IF you more details, Check the below thread.
    Re: How to store the invoice number in the head of the related delivery ?
    Regards,
    Madhan.
    Edited by: Madhan Babu C on Dec 11, 2009 6:57 AM

  • Problem with Variable in Query Designer.

    hi all,
    we have a variable ZAMREG on characteristic AM Region, where AM region is attribute for two different master data objects mastobj1 and mastobj2, we have different infosets build on these two master data objects along with some other ODS.
    now this variable ZAMREG is visible in one of the infosets only in query designer, whereas it is not visible in the other infoset.
    what could be the problem??
    thanks,
    Rk

    Hi,
    Please check if that variable is created locally or globally. If it is a local variable in any query, it will not appear in any other query.
    In anyways, you can always create one more variable if the older one is not available. This will not make much of difference. I would suggest go ahead with creating a new variable.
    Regards,
    Yogesh

  • Sorting Currency conversion Variables in Query Selection screen

    Hi Experts,
    I have an issue in sorting variables.
    A Currency translation is used here which has two selection options here, one for "Currency" and one for "Currency conversion date". They just pop in somewhere in the selection screen with out order. I want to put them together either in the middle or at the bottom.
    They are not visible in the Variable sequence tab of query properties.
    I changed the text for each of them (Ex. "XCurrency"), so that it sorts alphabetically, but no difference.
    Had anybody come accross this issue before.
    regards
    G Rai

    Hi,
    This seems strange that the variable does not show in the query properties. One thing I can suggest it to try changing the technical name/desciption of the variable if that changes the order.
    Please update back the thread if that helps.

  • Parsing List  in URL Variable for Query

    Hi, I am sending a url variable as in the following example:
    http://mypage.com/lookup.cfm?var=1001,1002,1003
    I then need to query a database given the string
    "1001,1002,1003" in #URL.VAR# to find all records that contain
    those RecID numbers in my table. Has anyone done this before, and
    if so what is the best way to accomplish this?
    Thanks!

    i tried using the following code, but keep getting an error:
    <cfif listLen(url.var) neq 0>
    <cfquery name="lookup" datasource="#application.dsn#">
    select *
    from INVENTORY_CATEGORIES
    where
    <cfloop list="#url.var#" index="i">
    <cfif isNumeric(i)>
    CATEGORY_ID= <cfqueryparam cfsqltype="cf_sql_integer"
    value="#i#">
    and
    </cfif>
    1=1
    </cfloop>
    </cfquery>
    <cfelse>
    <cfset LOOKUP.recordcount=0>
    </cfif>
    <table border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td> </td>
    <td> </td>
    </tr>
    <cfoutput query="lookup">
    <tr>
    <td> </td>
    <td>#row_id#</td>
    </tr>
    </cfoutput>
    </table>
    The error I am getting is:
    Error Diagnostic Information
    ODBC Error Code = 37000 (Syntax error or access violation)
    [Microsoft][ODBC Microsoft Access Driver] Invalid use of '.',
    '!', or '()'. in query expression 'CATEGORY_ID= Pa_RaM000 and 1=1
    CATEGORY_ID= Pa_RaM001 and 1=1'.
    The error occurred while processing an element with a general
    identifier of (CFQUERY), occupying document position (2:1) to
    (2:54).
    Date/Time: 07/24/06 09:50:54
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
    Remote Address: 127.0.0.1
    Query String: var=2042,2045
    Any ideas? Also, please keep in mind that the variables I
    will send across th eurl may also have letters. For example,
    var=m1001,1002,p30014. Thanks!

  • CF Set form.variable for query and Next/Previous pages error

    I have a CF form with a select that posts to a CF "action" page.
    On the action page I: CFSET ItemNumber=#form.ItemNumber#
    I CFOUTPUT the 'ItemNumber' into the CFQUERY (which is an Inner Join dependant on the '#ItemNumber#')...
    All of the above works just fine and displays the database fields in color alternating rows, per the rest of the code.
    Here's the problem:
    I'm displaying 40 rows on a page per "Next and Previous" code. (CFPARAM name="start" default="1" and CFPARAM name="disp" default="40" along with the rest of the NextN code in the header and body). This does display 40 rows on the page and puts a link at the bottom of the page "Next 40 Rows", etc.
    Note: I'm only querying the database once and using the query (query name="data") to populate the table rows And the NextN code (CFOUTPUT name="data") And (CFIF start + disp GREATER THAN data.RecordCount, etc)...
    The problem happens when you click the "Next 40 Rows" link to display the 2nd page of rows. Since (I'm assuming) this NextN code is 're-reading' the same page from top to bottom, an error is thrown when the code tries to read the CFSET ItemNumber=#form.ItemNumber# at the top of the page.
    With the #form.ItemNumber# on this action page Originally coming from the previous posting of the form to this action page, when the "Next 40 Rows" link is clicked and the NextN code re-reads this action page - the CFSET ItemNumber (#form.ItemNumber) is not getting populated and throws the error...
    I hope I've not made this sound confusing.
    I can get the NextN code to work when I'm just querying the database without "flying in" a form variable. But when I CFSET a variable (#form.ItemNumber#) that is inserted into the query, the second page of the NextN throws an error and doesn't display.
    I would include the page code here but it would be fairly lengthy and, as well, the NextN code is a 'standard' CF code -- I've narrowed the problem down to the above "Element is undefined" (when the page tries to reload from the "Next 40 Rows" link) and am hoping there's a simple fix or another way to display the records in Next and Previous pages.
    Thanks to anyone in advance for shedding light on this.
    - e

    Thank you for the reply, Owain.
    Yes - The Next/Previous at the bottom of the page are hyperlinks.
    <a href="ThisPage.cfm?start=#Evaluate("start + disp")#">
    The following is at the top of the page (and is the variable from the form that I CFOUTPUT in the query):
    <cfparam name="ItemNumberDropdown01" default="">
    <cfset ItemNumber = #form.ItemNumberDropdown01#>
    The error report showed that the "Next Page" hyperlink was reading an undefined variable... although when the "action page" first opens from the form posting to it, it populates the CFSET just fine (per the cfparam and cfset above)... As you mention, the hyperlink clearing the form scope is what causes the error in trying to display the next set of records...
    The form page and the 'action page' are both secure pages with an application page setting the session, etc. Am I at risk in using an URL scope?
    Where would this URL scope be put? (The href is shown above - would the URL scope go in this? - How would this be written?)
    The CFPARAM and CFSET would still exist at the top of the 'action page' and still throw an error wouldn't it or would this be replaced with something else to read the form.variable for this 'first' action page to be displayed?
    Thanks again for the 'education' on this...
    - ed

  • Conflict with text variable on Query Designer

    Hi,
    this is the scenario:
    - On Query Designer i got two restricted key figures: K1 and K2.
    - I'm usign a manual entered variable for 0CALMONTH.
    - On K1 the sales are restricted for the selected month.
    - On K2 the sales are restricted to a range between first month of the year, and the selected month-1.
    Then on a formula i use K1+K2 and a text variable (selected month) for the name of the column. Then, when running the query, the text for the variable can't be found. There is a conflict on text variable when using 2 restricted key figures on the formula.
    How can i solve it ?
    thx

    Hi,
    I assume that your text variable is of replacement type?
    If it doesn't work you can create a new text variable of user exit type and derive its value using entered 0CALMONTH.
    Best regards,
    Eugene

Maybe you are looking for

  • InfoPath form opens in the browser instead of InfoPath Filler when a link is clicked from the Approval Task email

    I have an admin approved InfoPath 2010 form that is web enabled. It is published to a SharePoint 2010 Forms library and an Approval Workflow is attached to it. The form needs to open up in the InfoPath Filler with the Workflow Task bar at the top so

  • Itunes wont open/ crashes, safari is buggy

    Hi, So i have a G5 dual 1.8 with 10.5 and have updated most everything and just yesterday updated safari to its current version and itunes as well. Now safari keeps giving me cannot open web page errors when i log in to sites like myspace or try to l

  • How to get Quicktime to play

    I'm new to Dreamweaver. I'm trying to created a simple webpage with a video in the middle of the page. I just want the video to play when you go to that page. Or you can use the > button... doesn't matter. WHat's happening is the page is trying to us

  • Iphoto 6 external drives

    Aloha, I am just moving to mac from PC and am concerned about using iphoto with an external drive. Will this mess up the applications, do i need a 3rd party library manager? a. iphoto buddy b. iphoto library manager if so why and which one? I have re

  • Remote control between two phones ?

    Hi Is there any S60 application which could control another (similar) phone (N or E series) remotely e.g. via Bluetooth ? There are somekind of VNC applications at market, but there is always PC involved. In my case I would like to control another ph