How to Use MAX condition using Query Report

Hi SAP Abap Expert,
Can we use the MAX condition in Query Report (SQ01/SQ02) ?
I have created one sample query using table VBRP and VBRK then i need to use max condition to get the MAX record in VBELN.
Please Help ???

Hi Ashishsingh,
According to your description, you want to know how to use MAX function in SQL Server Analysis Services MDX Query, right? In this case, please refer to the link below which describe the syntax and sample of MDX function.
http://technet.microsoft.com/en-us/library/ms145601.aspx
http://www.mdxpert.com/Functions/MDXFunction.aspx?f=64
Hope this helps.
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • What is the use of Condition is Query Designer  ??

    What is the use of Condition in Query Designer  ??
    How to use condition in   Query Designer  ??

    Hi,
    Conditions in a query can be defined for both characteristic combinations and key figures.
    Characteristic combinations can be used using the ranking list functionality (e.g Top N or Last N customers with highest sales).
    Key figures can be assigned the value limit conditions ( for e.g. display only rows in the query for which the key figure > 10 ).
    For your specific requirements in which you need to display only a limited set based on the key figures, then you can go for conditions.
    The conditions can be allowed to work on all the drill down characteristics independently, single characteristics or combination as well based on your requirement.
    While execution the report, you can activate or deactivate the condition anytime by right clicking on the data cells.
    Regards,
    VA

  • How to send inforecord conditions using ALE (message type COND_A)?

    Hi,
    I have sent Purchasing Inforecords through ALE using t-code ME18.
    Now, I would like to know how to transfer the conditions through ALE (message type is COND_A).
    Thanks a lot,
    Kaveri

    Hi,
    Please go through this thread.
    [Pricing Condition Records initial upload - COND_A]

  • How to find out if a query(report) has a role.

    I want to find out if a query(report) has a role and what the role name is.
    Do anybody know a function or a table?

    goto SU01 , give ur username , click on roles tab , and click F1 on role field , then goto technical attributes , and use where-used-list of that dataelement , u will lot of tables on Roles and its attributes
    You can look up AGR* tables in SE16
    Please give me reward points if it is useful.
    Thanks
    Murali Poli

  • How to use many conditions in query

    Hi all,
    i have a situation,must prepare a report to find availability of it devices.they are given the specific ip of devices.
    my query
    SELECT 
     Resultdate, [SERVICE]  ,[SERVICE TYPE] ,[IP]
    , DailyAvailability
      FROM [Orion].[dbo].[DepartmentNodesNew] t1
    left join (   select round(1-(sum([DownTimeMin])/(1440*count(*))),4)*100  as DailyAvailability,
      count(*) as Node,   c2.ResultDate  ,[Departament]  ,[IPAdress]
       from  [Orion].[dbo].[OrionEventsNodeDownTime] as c2 group by  [Departament] ,[IPAdress] , c2.ResultDate) t2
       on t1.IP=t2.IPAdress 
       where t2.DailyAvailability is not null and t1.SERVICE='SAP CRM' and t2.ResultDate='2014-12-10'
        order by ResultDate
    now how can i calculate the daily availability of sap crm which have 2 servers and they are in cluster,when one is down service is ok.when both of them are down service is off. how can i calculate by writing conditions.
     case when  ([SERVICE]='SAP CRM' AND [SERVICE TYPE]= 'DB Server' and [DownTimeMin] =0) then DBAvailability 100
      else  then DBAvailability select round(1-(sum([DownTimeMin])/(1440*count(*))),4)*100 ???

    SELECT Resultdate
    ,[SERVICE]
    ,[SERVICE TYPE]
    ,[IP]
    ,DailyAvailability
    INTO #TempTable
    FROM [Orion].[dbo].[DepartmentNodesNew] t1
    LEFT JOIN (
    SELECT round(1 - (sum([DownTimeMin]) / (1440 * count(*))), 4) * 100 AS DailyAvailability
    ,count(*) AS Node
    ,c2.ResultDate
    ,[Departament]
    ,[IPAdress]
    FROM [Orion].[dbo].[OrionEventsNodeDownTime] AS c2
    GROUP BY [Departament]
    ,[IPAdress]
    ,c2.ResultDate
    ) t2 ON t1.IP = t2.IPAdress
    WHERE t2.DailyAvailability IS NOT NULL
    AND t1.SERVICE = 'SAP CRM'
    AND t2.ResultDate = '2014-12-10'
    ORDER BY ResultDate
    SELECT Resultdate
    ,[SERVICE]
    ,[SERVICE TYPE]
    ,[IP]
    ,DailyAvailability
    ,CASE
    WHEN (
    [SERVICE] = 'SAP CRM'
    AND [SERVICE TYPE] = 'DB Server'
    AND [DownTimeMin] = 0
    THEN 100
    ELSE round(1 - (sum([DownTimeMin]) / (1440 * count(*))), 4) * 100
    END AS 'DBAvailability'
    FROM #TempTable
    -Vaibhav Chaudhari

  • Using MAX API to generate report

    I am trying to automate a software installation procedure through the use of the NIMAX_GenerateReport() function. We have a software installation that requires a manual edit operation after the installation.  After installing the software the user examines the memory range of a 6602 counter/timer card in NI-MAX and then edits the value into an INI file that the software reads at run time.
    I am exploring the possibility of automating this step by having the installer call the NIMAX_GenerateReport() function to generate an XML report and then read the memory range from the XML report file and finally edit the INI file with the memory range value read from the report. To test this out I wrote a small command line LabWindows program that called the generate report function. It worked fine on my build machine but when I tried to run it on the target machine I get the following error return from the generate report function call: "An unknown error occurred".  The version of NI-MAX on the target PC is 3.1 and the version on the build PC is 4.6.2. I was wondering if the version of NI-MAX on the target PC is too old to support the NI-MAX API. My questions are:
    1. Is this a valid way to programmatically obtain the memory range information from the 6602 card or is there a better way?
    2. How can I upgrade the version of NI-MAX on the target PC. I'm not sure what installs it.
    Thanks,
    Jim

    Hello Jim,
    The way you are going about your coding sounds correct.  Per your second question, MAX installs when you update the computer drivers.  To do this go to ni.com/drivers, search for DAQmx, and then download the most current version of DAQmx that is compatible with your computers.  By installing a newer version of DAQmx MAX will automatically be updated.  
    Regards,  
    Marcus
    Marcus M.
    PXI Product Support Engineer
    National Instruments

  • Use of Conditions in query

    Hi,
         While using conditions, there are 2 options mentioned
    1.all the characteristics in the drill down independently
    2.Single characteristics or combination of characteristics
    Can someone explain me the above two with examples?

    Hi,
    This property would allow to choose if we would like to apply the conditions to all the characteristics or particular characteristic.
    Typically we select - All Characteristics in the Drilldown Independently
    This setting allows you to apply a condition in a general way. Depending on which characteristics you use in the drilldown, you obtain different results.
    Single Characteristics and Characteristic Combinations
    This setting allows you to evaluate the condition for characteristics or characteristic combinations defined for specific drilldowns only. You can select any characteristic (of the characteristics used in the query in rows, columns, or in the free characteristics) or a characteristic combination.
    Thanks.

  • How to write if condition in Interactive reporting

    Hi,<BR>Following function is existing in cognos<BR>if ( Calculation in the Report starts with M ) then ( 1 ) else ( months-between ( FolderItemRef[Prompts.Common.Dates.EffStartDt],FolderItemRef[Prompts.Common.Dates.EffEndDt] ) + 1 ) <BR><BR>I need to incorporate same in the Interactive reporting.I can keep Calculation in the report,EffStartDt,EffEndDt as the prompt and can get the value. But at query request line how can i incorporate the above expression so that i can get the output as the column in result set.<BR><BR>In addition to creation of computed column what else need to be done. Nullif function cannot be useful.<BR><BR>Let me know your points.<BR><BR>Regards<BR>R.Prasanna

    <p>Hi prsan,</p><p>When you create a computed item column you can add standardJavaScript into the definition. To find out whether the valuestarts with an 'M' we can use the Substr built in function whichtakes a string, the start position of the substring and the numberof characters, for the else part of your conditional we can use theMonthsBetween built in function.</p><p>So if the column you are referencing is called Calc_In_Report wecan define the computed item as the if statement below.</p><p>Cheers,</p><p>--Ryan</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to put this condition in Query

    Dear experts,
    I have a scenario where in the calculation should be dynamic between key figures in query
    For example i have a
    Target Cost and Actualcost1, Actualcost2, Actualcost3
    i need to findout the variance between the Target and Actual
    but the catch is that i need to findout the variance with the latest actual cost
    1. )  Target cost = 100
    Actual cost1=10, Acutal cost2=0, actual cost3=0
    then the formula should be Actual cost1-target cost
    2. )But if
    Target cost  =100
    Actual cost1=10, Actual cost2=5, Actual cost3=0
    then the formula should be Actual cost2- Target cost
    3. Target cost =100
    Actual cost1=10, Actual cost2 = 5, Actual cost3= 15
    then the formula should be Actual Cost3-Target cost
    How to achieve this
    Thanks and regards
    Neel

    Hi Neel,
    Do you have indicator saying that a particular actual cost is the latest? If you have any indicator thsi would make the job easy. Else you need to create new formulas to derive the logic.
    Else you can proceed with the belwo logic.
    1.target cost
    2. Actual Costs 1 - Hide
    3. Actual Costs 2 - Hide
    4. Actual Costs 3 - Hide
    5. New formula whcih evaluates the latest.
    Write the condition
    If Actual costs3 = 0 and actual cost2 = 0 then actual cost1.
    else if actual cost2= 0 then actual cost1
    else if actual cost1 NE 0 and actual cost2 NE 0 then Actual cost3.
    Then hide the above new formula.
    And in a new formula you can find the diff between the Target cost and the latest cost derived in teh above new formula.
    If the conditions is too big in the above new formula, you can split across two three new formulas and derive the logic.
    Just make some changes to the above logic if it is not 100%.
    I believe this logic will work.

  • How to find GENUNIID  for a query/report

    Hello All,
    I have a report/query and i need to find GENUNIID. Please provide me the table name. There is one table RSRREPDIR but i am not able to find out the report name/query name out of this. Please help me.
    Thanks,
    Rathy.

    Chek this FM RRI5_GENUNIID_FROM_COMPUID_GET.
    For compuid , check RSZELTDIR , give query name in MAPNAME fileld , corresponding ELTUID is the compuid to be given in above FM
    Edited by: Neetika Sharma on Jun 3, 2010 8:30 AM

  • How to delete duplicate record in Query report

    Hi Experts,
    I had created an infoset and query in my sap, but I want to delete some duplicate records before the list out put.Please can we add some further codes in the Extras code to delete duplicates? And how do it? Would you please give me a simple brief.
    Joe

    Hi,
    You can try to restrict in the filter area in query designer with the values for characteristic which gives correct
    result.
    But still i would suggest that in the cube you keep not the duplicate records as this is not your requirement and giving
    you wrong result.
    So you can reload the correct records in the cube inorder to avoid such problems even in future.
    Regards,
    Amit

  • How to insert code conditions ina QUERY

    Hi All,
    I'm creating a Query to extract the data from EKKO, EKPO and EKKN.
    here I have to insert a piece of code as checking below.
    IF EKPO-KNTTP ne '   '.      "not equal to blank
    extract the data from table EKKN.
    ENDIF.
    here I need your help like how to write this code in a Query.
    Thanks,
    Sunil Bodda.
    Edited by: sunil bodda on Apr 15, 2009 12:05 PM

    Hi Sunil,
    You need to code it in infoset. follow the steps below.
    1. Goto SQ02, enter your infoset.
    2. Click on "Extras" button(above find button). On the next page you will find a "Code" tab. 
    3. Declare a constant as space. choose DATA in the drop down for coding section.
    4. Choose "Record processing" or if any other appropriate choice from the drop down in the coding section.
    5. CHECK EKPO-KNTTP EQ c_space. and write your code here.
    Hope this helps.

  • *** How to add dynamic condition to Query ***

    Hi All,
    Could you please help me out logic
    i need only query
    There is tables emp, dept
    SELECT E.ENAME,D.DNAME
    FROM EMP E, DEPT D
    WHERE d.DEPTNO = e.DEPTNO(+)
    AND (DYNAMIC CONDITION)
    DYNAMIC CONDITION LOGIC IS
    IF D.DEPTNO IS THERE IN E.DEPTNO THEN [E.JOB = 'MANAGER'] --- CONDITIION SHOULD ADD IN THE PLACE OF (DYNAMIC CONDITION)
    IF D.DEPTNO IS NOT THERE IN E.DEPTNO THEN [ D.LOC = 'LONDON'] --- CONDITIION SHOULD ADD IN THE PLACE OF (DYNAMIC CONDITION)
    I tried below
    select e.ENAME, e.SAL, d.dname from emp e, dept d
    where CASE WHEN e.deptno = d.deptno then e.job = 'MANAGER'
    else D.loc = 'LONDON'
    END
    But its giving error...
    Please give a solution
    Thanks in Advance
    KC

    SELECT E.ENAME,D.DNAME, d.loc, e.job, e.deptno
    FROM EMP E, DEPT D
    WHERE d.DEPTNO = e.DEPTNO(+)
    and (
           (e.deptno is null and d.loc='LONDON')
             or
           (e.deptno is not null and e.job='MANAGER')
         );  (But thats no dynamic sql!)

  • To schedule query reports

    Dear Experts
    Please let me know how can to cinfigure scheduler on query reports in 8.81?
    Thanks in Advance
    Regards
    Kanishka Tyagi

    Hi Kanishka ,
    You can schedule the query by using Alert Management
    You have to set a alert based upon that query
    and have to set the frequency (may be Hours / Day / week / Months)
    on a specified Time .
    Hope it Helps
    Thanks
    Ashish

  • How to create greater_or_equal condition for file_io storage

    Dear experts,
    Please tell me the how to create greater_or_equal condition for query in file_io as RationalOperatorType.GREATER_OR_EQUAL is not supported for file_IO storage.
    thanks n regards,
    Kapoorchand.

    Hi,
    not sure if I got you correctly, but in
    com.sap.ip.me.api.persist.query.RelationalOperatorType
    There is no condition available that you are looking for. Why do you not work with
    public interface Condition
    Represents a condition for a query. This can either be a single condition, as FIELD = VALUE and / or a composite condition, as ( ( FIELD1 = VALUE1 OR FIELD2 = VALUE2 ) AND FIELDE 3 <> VALUE3 ).
    Hope this helps!
    Regards,
    Oliver

Maybe you are looking for

  • Can Mainstage 2 drive Apple Keynote, or other video/slides?

    Greetings fellow Keynoticians... I've used Keynote for years in concert, and am looking to upgrade to '09. I'm also a Logic 8 newbie, and am looking to upgrade to 9, mainly for Mainstage 2. I'm a one-man band. Years ago I used to have a full-blown MI

  • Installing 10.2.0.1 on OEL5, ocr and vote

    Hello, I am having a challenge getting the raw devices setup for ocr and vote, 10.2.0.1 and OEL5. I have followed the steps in note 443996.1 and 465001.1 and not having any luck. Here is the contents of the 55-oracle-naming.rules: # cat /etc/udev/rul

  • 1310 Bridge - can it work without an external antenna?

    I have 2 1310 outdoor bridges- I can only connect them using external antennas. Is there something wrong in the configuration where im not able to use the internal antenna: attached is the config: Current configuration : 1371 bytes version 12.4 no se

  • Do I need 8 gigs for lion on mac pro?

    Do I need 8gigs for lion?

  • Creating runtime environment

    Hello APEX Community, I am a DBA and have successfully installed the APEX full development environment on a server. On the same server but a different database, I want to install the APEX runtime environment. How will this work? For the runtime envir