About get max value

Hi,
  I want to know how to sign a summary field with some colors.
  For example,I made a report about every itemgroup's sales in each client.So I made two groups,the first is client,and the other is itemgroup,the sales is the summary field,I want to format the max sales values with red colors in the every client group,but the function maxium can not support the summary field,how can I do? Thanks.

You could use a Database Command as your data source, and aggregate the sales per item group in the command, so the command returns client, item group, and total sales per client/item group.
Then, in the Font Color (or background color) formula, use (basic syntax):
if {sales} = maximum({sales}, {client})) then
  formula = crRed
else
  formula = crBlack
end if
(Another thought I had using the detail data, but I'm not sure it'll work, is to use
if {sales} = maximum(sum({sales}, {item group}), {client})
  formula = crRed
else
  formula = crBlack
end if
I don't know if you can nest aggregates, though...)
HTH,
Carl

Similar Messages

  • How to get Max value in Essbase

    Hi,
    I have problem to get max value from 3 years in Essbase.
    How can i get max value from Dec 2009,Dec 2010, Dec 2011.
    Suppose value of Dec 2009 = 1000, Dec 2010 = 1500 and Dec 2011 = 2000
    I want to get max value from these three value, how can i do that in Essbase Calculation Script.
    Any idea?
    Thanks.
    Regards,
    Joni

    You have not specified if year and period are separate dimensions, anyway as always there a number of different possbilities and I don't have much time today to think about it but one method could be to use @MAXRANGE
    FIX(Other members to fix on,"Dec")
    "MemberToStoreAgainst" = @MAXRANGE("MemberToFindMaxRangeFor","2009:"2011");
    ENDFIX
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Get max value with other fields

    Hi All,
    I have a table as below
    Name Value
    A1     5
    A3 10
    A2 7
    A2 9
    A1 10
    What I would like to get is the max(Value) and with grouping of its name
    Name     Value
    A2 16
    Thanks
    Alex
    Edited by: user8606416 on 01-Jun-2011 10:17
    Edited by: user8606416 on 01-Jun-2011 10:26

    Depending on how you feel about ties one of:
    SELECT name, value
    FROM (SELECT name, SUM(value)
          FROM table
          GROUP BY name
          ORDER BY 2 DESC)
    WHERE rownum = 1
    SELECT name, SUM(value)
    FROM table
    GROUP BY name
    HAVING SUM(value) >= ALL (SELECT SUM(value)
                              FROM table
                              GROUP BY name)among many other methods. The first will pick a single arbitrary record in case of a tie, the seond will show all of the tied records.
    John

  • SSAS Tabular DAX- Need to get MAX value of the MIN (top)hierarchy level row

    EDIT:
    I got closer to resolving the issue using MAX. 
    However, If I remove the department hierarchy and just place on the MAX measure I get the single largest value out of all departments. 
    It would be ideal if the measure could still SUM the "top level" values across everything in the system if the hierarchy is not placed on the rows grouping.
    So it returns the largest value for a given department, but if the department hierarchy isn't present I need it to return a SUM of all the level 1 values for all departments...
    Basically return MAX value from the MIN L1ID's DeptLevel value, but I can't seem to construct that DAX query.  So if DepartmentID hierarchy is on display it gets MAX per row, but if that is removed it dips into MAX GoalValue for each L1ID grouping with
    the MIN DeptLevel.
    /EDIT
    I have a rather odd data table I'm bringing into a SSAS Tabular model.
    Instead of having all data at each child level and then it adding up to a grand total in the parent, it has a grand total predefined at each child level.
    I just need this tool to display the raw data if at all possible instead of trying to aggregate everything. Filter on active level, ignore child levels.
    Is there a way to do that?
    Example:
    SalesGoalsByDepartmentLevel:
    Level1 (top level) = 5,000
    Level2( lower level) = 0
    Level3(lower still) = 500
    Level 4(lowest) = 4,250
    So note that adding up all the child levels is still $250 shy of the top 5,000.
    IT is just an odd business rule, basically each level is expected to meet that goal or exceed it, the top level goal is 5,000 but management doesn't care where that last 250 comes from, they do are that each defined level is met.
    These levels are in a hierarchy so if I view the top level of the hierarchy it adds up to 4250+500+5000=9750 when I just want to see 5,000 at the top level and the details when they drill down.
    I added a filter to just filter to the top level, but then when I drill down of course those lower levels are blank.
    Is there a way to filter on the current displayed level without aggregating all child levels?
    Thanks!

    You might want to take a look at the Parent-Child Hierarchies pattern here:
    http://www.daxpatterns.com/parent-child-hierarchies/
    You might write DAX code to check what is the "current" level (see BrowseDepth measure in the sample file you can download) and depending on its level, se the filter to blank to all the levels below, so you don't aggregate "children".
    Just an idea, I'm not sure if it corresponds to your requirement and I don't have time to make more tests.
    I hope it will be helpful.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • How to get max value of a column in VO?

    Hi ,
    i need to find the max value of a column named insured value in VO.
    Please help!!

    Hi,
    If this value is cuming from the Query then u can easily go for MAX function. If its a user enterable value then u need to iterate through all the rows for that column to find the max of them.
    Let me know.
    Regards,
    Gyan

  • About getting the values from a FM

    Hi experts,
                     I have used the function module 'HR_READ_INFOTYPE' to get all the field values of the infotype 0008 (Basic Pay). I have given the infty as 0008 in exporting and infty_tab as p0008 in tables. But it shows a run time error (short dump). Can anyone help me to know how to use the HR_READ_INFOTYPE.
    Regards,
    Shanthi.

    Hi shanthi,
    1. Just check your code. Some parameter,
       which is compulsary is not passed or commented.
    2. The compulsary parameters are :
    PERNR
    INFTY
    INFTY_TAB
    3. like this.
    4.
    report abc.
    data : p0008 type table of p0008.
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
      TCLAS                 = 'A'
        PERNR                 = '1009'
        INFTY                 = '0008'
      BEGDA                 = '18000101'
      ENDDA                 = '99991231'
      BYPASS_BUFFER         = ' '
      LEGACY_MODE           = ' '
    IMPORTING
      SUBRC                 =
      TABLES
        INFTY_TAB             = p0008
    EXCEPTIONS
       INFTY_NOT_FOUND       = 1
       OTHERS                = 2
    break-point.
    regards,
    amit m.

  • How to get Max value in String

    Example
    Col1
    A
    B
    Expected Answer IS
    B.

    Check this:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'BZZZ' col from dual union select 'BACD' from dual)
      2* select max(col) from t
    SQL> /
    MAX(
    BZZZ
    SQL> The first character is 'B', so it looks for next character which is "Z" for first value and "A" for second value, and it returns first value.

  • Get max value

    hi all,
    i have the following data
    with table1 as
      select to_date('01/01/2010', 'mm/dd/yyyy') dt, 2 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 1 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 3 cid from dual
      union all
      select to_date('05/11/2010', 'mm/dd/yyyy') dt, 4 cid from dual
    ) i would like to write a query that gives me the max dt with corresponding id.
    for example, if i specify to_date('04/01/2010', 'mm/dd/yyyy') then the output should be
    dt cid
    ===============
    3/01/2010 3
    if i specify 1/2/2010 then output should be
    dt cid
    ===============
    1/01/2010 2
    as you can see, i want the max < specify date. also i want the correspoding cid that belongs to that date specify
    can someone help me write a query that give output above

    with table1 as
      select to_date('01/01/2010', 'mm/dd/yyyy') dt, 2 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 1 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 3 cid from dual
      union all
      select to_date('05/11/2010', 'mm/dd/yyyy') dt, 4 cid from dual
    select max(dt) max_dt,
             max(cid) keep (dense_rank last order by dt)  cid
    from table1
    where dt <= to_date('04/01/2010', 'mm/dd/yyyy') -- perhaps you need "<" instead of "<=" here !
    with table1 as
      select to_date('01/01/2010', 'mm/dd/yyyy') dt, 2 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 1 cid from dual
      union all
        select to_date('03/01/2010', 'mm/dd/yyyy') dt, 3 cid from dual
      union all
      select to_date('05/11/2010', 'mm/dd/yyyy') dt, 4 cid from dual
    select max(dt) max_dt,
             max(cid) keep (dense_rank last order by dt) cid
    from table1
    where dt <= to_date('01/02/2010','mm/dd/yyyy')  -- perhaps you need "<" instead of "<=" here !Edited by: hm on 25.10.2010 12:57

  • Dynamically get the Max value from table and insert max value + 1 in Target

    Hi All, I have a requirement given below, need help in building a solution for this: A mapping that will get the dynamically get the max value(Basically a number) from table , this target table is used by many other concurrent jobs and updated very frequently. My requirement is to get max value from this target table dynamically (Using dynamic look up) and then have an expression to increment by 1 and then load it to Target.I tried using SELCT max(col1) from target in dynamic look up override but this does not seem to work.Any work around here? I dont insist on using a SQL transformation here as Production DB could have 3 Million + records! Thanks in advance, -KRB

    Q/微信859034112办理科廷/ECU/MU/西澳大学毕业证成绩单及真实使馆教育部认证/永久可查Q/微信859034112办理USYD/UNSW/MQ/UTS/Monash/悉尼大学毕业证成绩单及真实教育部认证专业面向澳洲留学生提供以下服务: 一:毕业证、成绩单等全套材料,从防伪到印刷,从水印到钢印烫金,水印底纹。二:真实使馆认证(留学人员回国证明),使馆存档可通过当地使馆查询三:真实教育部认证,教育部永久存档,教育部留服网站永久可查 四:真实留信认证,留信网入库存档,永久可查  现在教育部认证办理已经不需要提供回国证明(使馆认证),如无需要,请注意办理流程!联系人:kevin  QQ: 859034112     微信:859034112如果您是以下情况,我们都能竭诚为您解决实际问题:1、在校期间,因各种原因未能顺利毕业,拿不到官方毕业证; 2、面对父母的压力,希望尽快拿到; 3、不清楚流程以及材料该如何准备; 4、回国时间很长,忘记办理; 5、回国马上就要找工作,办给用人单位看; 6、企事业单位必须要求办理的; 请联系英华教育客服kevin,专业负责为您排忧解难!资深业务!联系人:kevin    QQ: 859034112      微信:859034112 澳洲各大高校均可办理,样板齐全。 悉尼大学 TheUniversity of Sydney  新南威尔士大学TheUniversity of New South Wales  墨尔本大学 The University ofMelbourne  阿德莱德大学 Adelaide University   莫纳什大学 Monash University   昆士兰大学The University of Queensland    西澳大学 The University of WesternAustralia  澳大利亚国立大学 The Australian National University   麦考瑞大学 Macquarie University   纽卡斯尔大学 TheUniversity of Newcastle 卧龙岗大学 University of Wollongong  格里菲斯大学 Griffith University   佛林德斯大学 Flinders University  塔斯马尼亚大学 University of Tasmania  西悉尼大学Universityof Western Sydney   邦德大学Bond University    迪肯大学 Deakin University  悉尼科技大学 University of Technology ,Sydney    科汀科技大学 Curtin University of Technology  墨尔本皇家理工学院 RMIT University  昆士兰科技大学QueenslandUniversity of Technology    拉筹伯大学 La Trobe University  莫道克大学 Murdoch University  堪培拉大学 University of Canberra 旋宾科技大学 Swinburne University of Technology南澳大学Universityof South Australia  中央昆士兰大学 University of Southern Queensland   查尔斯特大学  Charles SturtUniversity  詹姆斯库克大学 James Cook University       圣母大学 Notre Dame  新英格兰大学 The University of NewEngland     南昆士兰大学  Universityof Southern Queensland  澳洲天主教大学 Australia CatholicUniversity巴里迪大学Universityof Ballarat  埃迪斯科文大学 Edith Cowan University  南十字星大学 Southern Cross University  阳光海岸大学 University of Sunshine Coast  维多利亚大学VictoriaUniversity   北领地大学 NorthernTerritory University诚招代理:本公司诚聘当地代理人员,如果你有业余时间,有兴趣就请联系我们。敬告:面对网上有些不良个人中介,真实教育部认证故意虚假报价,毕业证、成绩单却报价很高,挖坑骗留学学生做和原版差异很大的毕业证和成绩单,却不做认证,欺骗广大留学生,请多留心!办理时请电话联系,或者视频看下对方的办公环境,办理实力,选择实体公司,以防被骗!  办理悉尼大学USYD毕业证Q/微信859034112成绩单学历认证 University of Sydney 办理新南威尔士大学UNSW毕业证Q/微信859034112成绩单学历认证 University of New South Wales 办理墨尔本大学Melbourne毕业证Q/微信859034112成绩单学历认证 University of Melbourne 办理昆士兰大学Queensland毕业证Q/微信859034112成绩单学历认证 University of Queensland 办理麦考瑞大学MQU毕业证Q/微信859034112成绩单学历认证 Macquarie University 办理莫纳什大学Monash毕业证Q/微信859034112成绩单学历认证 Monash University 办理澳洲国立大学ANU毕业证Q/微信859034112成绩单学历认证 Australian National University 办理澳洲天主教大学ACU毕业证Q/微信859034112成绩单学历认证 Australian Catholic University 办理悉尼科技大学UTS毕业证Q/微信859034112成绩单学历认证 University of Technology Sydney 办理查尔斯特大学CSU毕业证Q/微信859034112成绩单学历认证 Charles Sturt University 办理格里菲斯大学Griffith毕业证Q/微信859034112成绩单学历认证 Griffith University 办理科廷大学Curtin毕业证Q/微信859034112成绩单学历认证 Curtin University 办理西悉尼大学UWS毕业证Q/微信859034112成绩单学历认证University of Western Sydney 办理澳洲纽卡斯尔大学Newcastle毕业证Q/微信859034112成绩单学历认证 University of Newcastle 办理昆士兰科技大学QUT毕业证Q/微信859034112成绩单学历认证 Queensland University of Technology 办理皇家墨尔本理工学院RMIT毕业证Q/微信859034112成绩单学历认证 RMIT University 办理卧龙岗大学Wollongong毕业证Q/微信859034112成绩单学历认证 University of Wollongong 办理迪肯大学Deakin毕业证Q/微信859034112成绩单学历认证 Deakin University 办理拉筹伯大学毕业证Q/微信859034112成绩单学历认证 La Trobe University 办理新英格兰大学UNE毕业证Q/微信859034112成绩单学历认证 University of New England办理阿德莱德大学Adelaide毕业证Q/微信859034112成绩单学历认证 University of Adelaide办理西澳大学毕业证Q/微信859034112成绩单学历认证 University of Western Australia办理堪培拉大学Canberra毕业证Q/微信859034112成绩单学历认证 University of Canberra办理塔斯马尼亚大学Tasmania毕业证Q/微信859034112成绩单学历认证 University of Tasmania办理澳洲维多利亚大学Victoria毕业证Q/微信859034112成绩单学历认证Victoria University办理中央昆士兰大学CQU毕业证Q/微信859034112成绩单学历认证 Central Queensland University办理邦德大学Bond毕业证Q/微信859034112成绩单学历认证 Bond University办理南昆士兰大学USQ毕业证Q/微信859034112成绩单学历认证 University of Southern Queensland办理南澳大学USA毕业证Q/微信859034112成绩单学历认证 University of South Australia办理斯威本科技大学SUT毕业证Q/微信859034112成绩单学历认证 Swinburne University of Technology办理詹姆斯.库克大学JCU毕业证Q/微信859034112成绩单学历认证 James Cook University办理澳洲圣母大学UND毕业证Q/微信859034112成绩单学历认证 University of Notre Dame办理南十字星大学SCU毕业证Q/微信859034112成绩单学历认证 Southern Cross University办理弗林德斯大学Flinders毕业证Q/微信859034112成绩单学历认证 Flinders University办理莫道克大学Murdoch毕业证Q/微信859034112成绩单学历认证 Murdoch University办理埃迪斯科文ECU大学毕业证Q/微信859034112成绩单学历认证 Edith Cowan University 办理查尔斯达尔文大学CDU毕业证Q/微信859034112成绩单学历认证 Charles Darwin University办理巴拉瑞特大学Ballarat毕业证Q/微信859034112成绩单学历认证 University of Ballarat办理阳光海岸大学USC毕业证Q/微信859034112成绩单学历认证University of Sunshine Coast

  • Using groovy expressions to get a value of the current row

    Hi,
    I have a bounded task flow. The first step in the flow is calling an ExecuteWithParameters on one of my views. Based on the result of this query, I want to go to either Page1 or Page2.
    So I have a router. I first tried to route based on whether or not the result of the query contained only one row. That worked fine. But I want to add a condition to that.
    Basically, if the query returns one row AND that row has an attribute named 'Noc' == 1, then I want to go to Page2. Otherwise, go to Page 1.
    Right now to get the estimatedRowCount I am getting the iterator from the pageDef file created for my ExecuteWithParams object. To see if 'Noc' == 1, I tried this:
    #{data.rcl_view_reimbCode_search_results_task_flow_reimbCode_search_results_task_flow_ExecuteWithParamsPageDef.ReimbCodeSearchView1Iterator.currentRow.getAttribute("Noc") == 1}
    But it is complaining of grammar issues.
    What is the best way to go about getting the value of my attribute in a groovy expression?
    Thanks,
    Joel

    Hi,
    the best way is to use a managed bean reference
    1. create a binding for the router
    2. Expose the queried iterator in the PageDef file
    3. write a managed bean that accesses the binding
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentEntry();
    DCIteratorBinding iter = bindings.get("NameOfIterator");
    // i) get estimated row count
    // ii) get attribute value
    //iii) evaluate
    // iv) return true/false
    Reference the managed bean from the router
    Frank

  • Max value is same in report

    Hi Sap Experts
    I am not getting same min value from max can anyone correct my program please
    I am getting max value but in place of min I am getting the same value of max.
    I am searching with equipment range , monthly date range and unit of measurment (km,L,H)
    REPORT Z_ESLP_FUEL LINE-SIZE 200 LINE-COUNT 75
    NO STANDARD PAGE HEADING.
    TABLES : equi,
    equz,
    imptt,
    imrg,
    eqkt,
    iloa.
    Type Declaration
    TYPES: BEGIN OF ty_data ,
            equnr type equnr, " Euipment no
            eqktx type eqkt-eqktx, " Equipment Text
            eqfnr type iloa-eqfnr, " Equipment Sort field
            idate type imrg-idate, " Measuring Date
            recdu type imrg-recdu, " Unit of measuring ='KM','L','H'
            recdv type imrg-recdv, " Counter reading data
          END OF ty_data.
    TYPES: BEGIN OF ty_final,
            equnr type equnr, " Equipment no
            eqktx type eqkt-eqktx, " Equipment Text
            eqfnr type iloa-eqfnr, " Equipment Sort field
            min_date type imrg-idate, " Min Date
            min_km type p decimals 2, " Max Km
            max_km type p decimals 2, " Min km
            t_max_min_km type i, " Total min_km-max_km
            max_date type imrg-idate, " Max Date
            min_hr type imrg-recdv, " Max hr
            max_hr type imrg-recdv, " Min hr
            t_max_min_hr type i, " Total min_hr-max_hr
            min_lit type imrg-recdv, " Max lit
            max_lit type imrg-recdv, " Min lit
            t_max_min_lit type i, " Total min_lit-max_lit
            fuel_con type p decimals 2, " Total_hrs / t_max_min_hr
            km_l type p decimals 2, " km / L
            lit_per_hr type i , " fuel comsumed / t_max_min_hr
          END OF ty_final.
    DATA: i_data TYPE TABLE OF ty_data, " internal table
          wa_data TYPE ty_data, " work area
          i_final TYPE TABLE OF ty_final, " internal table
          wa_final TYPE ty_final. " work area
    data: begin of itab occurs 0,
    num type i,
    end of itab.
    data: v_min_1 type i,
    v_max_1 type i,
    min like imrg-recdv,
    max like imrg-recdv,
    max_dt like imrg-idate,
    min_dt like imrg-idate,
    t_ma_mi type p decimals 2,
    V1 LIKE  IMRG-RECDV  ,
    V2 LIKE IMRG-RECDV  .
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: p_equnr FOR equi-equnr ,"no-extension no intervals,
    p_idate FOR imrg-idate, "NO-EXTENSION NO INTERVALS OBLIGATORY,
    p_recdu FOR imrg-recdu. "NO-EXTENSION NO INTERVALS default 'M3'" OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN END OF BLOCK blk2.
    SELECTION-SCREEN END OF BLOCK blk.
    TOP-OF-PAGE.
      FORMAT INTENSIFIED ON.
      WRITE:/1(40) ' INVESTMENT LIMITED '.
      WRITE:/50(40) ' FUEL CONSUMPTION REPORT ' CENTERED ,
      2 'Page', sy-pagno.
      FORMAT INTENSIFIED OFF.
      WRITE:/50(40) '----
    ' CENTERED .
      FORMAT INTENSIFIED ON.
      WRITE:/2 sy-datum COLOR 3, sy-uzeit .
      "WRITE:/1 S903-SPMON ."p_yearf.
      ULINE.
      "CENTERED.
      write: /2 'Date From :'.
      write: /2 'Equipment No :'.
      write: /2 'Unit :'.
      SKIP.
      ULINE.
      WRITE:/1 sy-vline,
      2 'EQUIP NO', 10 sy-vline,
      11 'NAME', 40 sy-vline,
      41 'min date', 50 sy-vline,
      51 'max date', 60 sy-vline,
      61 'min km', 70 sy-vline,
      71 'max km' , 80 sy-vline,
      81 't_max_min_km', 90 sy-vline,
      91 'min hr', 100 sy-vline,
      101 'max hr', 110 sy-vline,
      111 't_max_min_hr' , 120 sy-vline,
      121 'min lit', 130 sy-vline,
      131 'max lit', 140 sy-vline,
      141 't_max_min_lit', 150 sy-vline,
      151 'fuel con', 160 sy-vline,
      161 'km_l', 170 sy-vline,
      171 'lit_per_hr', 180 sy-vline.
      FORMAT COLOR 3 ON.
      ULINE.
    END-OF-PAGE.
    START-OF-SELECTION.
      select aequnr deqktx feqfnr eidate erecdu erecdv
      into table i_data
      from equi  AS a
      inner join equz as b
      on aequnr = bequnr
      inner join iloa as f
      on biloan = filoan
      inner join imptt as c
      on aobjnr = cmpobj
      inner join eqkt as d
      on aequnr = dequnr
      inner join imrg as e
      on epoint = cpoint
      where a~equnr in p_equnr
      and
      e~idate in p_idate
      and
      e~recdu in p_recdu.
        LOOP at i_data into wa_data.
             SORT i_data BY  equnr idate descending .
             "Read table i_data into wa_data index 1.
               move wa_data-recdv to max.
             SORT i_data BY  equnr idate ASCENDING .
            "Read table i_data into wa_data index 1.
               move wa_data-recdv to min.
         on change of wa_data-equnr.
         write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,wa_data-recdu ,
         'MIN',max EXPONENT 0 DECIMALS 2,
         'MAX',min EXPONENT 0 DECIMALS 2.  .
         endon.
        endloop.
        loop at i_data into wa_data.
        SORT i_data BY  equnr idate descending .
        move wa_data-recdv to max.
        endloop.
        loop at i_data into wa_data.
        SORT i_data BY  equnr idate ascending .
        move wa_data-recdv to min.
        endloop.
    regards
    Piroz

    Hi Experts
    I got the result but it is dividing in two lines one for max and another for min but I want the sub total subtraction after each max and min
    max   192300.00
    min    182139.00
    ========================
    max-min = 10161.00
    ========================
    max   649209.00
    min    642962.00
    ========================
    max-min = 6247.00
    ========================
         SORT i_data BY equnr idate descending .
    loop at i_data into wa_data.
            max = wa_data-recdv.
            min = wa_data-recdv.
    at new equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'max',max EXPONENT 0 DECIMALS 2,wa_data-recdu .
            endat.
    at end of equnr.
            read table i_data into wa_data index sy-tabix.
            write:/ wa_data-equnr, wa_data-eqktx ,wa_data-eqfnr ,wa_data-idate ,'min', min EXPONENT 0 DECIMALS 2, wa_data-recdu .
    on change of wa_data-equnr.
    t_ma_mi = max - min.
    write:/ t_ma_mi.
    endon.
    endat.
    at end of equnr.
    SUM.
    write:/ '----
    endat.
    endloop.
    regards
    Piroz

  • Need help regarding complex calculation using Max value and limiting data after Max date in MDX

    I am working on a bit complex calculated measure in SSAS cube script mode.
    Scenario /Data Set
    Date
    A
    B
    C
    A+B
    5/29/2014
    Null
    34
    Null
    34
    6/30/2014
    Null
    23
    45
    68
    7/15/2014
    25
    -25
    Null
    0
    8/20/2014
    -34
    Null
    Null
    -34
    9/30/2014
    25
    Null
    60
    25
    10/15/2014
    45
    -45
    Null
    0
    11/20/2014
    7
    8
    Null
    15
    a) Need to capture latest non-null value of Column C based on date
    with above example it should be 60 as of 9/30/2014
    b) Need to capture column A+B for all dates.
    c) Add values from column (A+B) only after latest date which is after 9/30/2014. 
    with above example it's last 2 rows and sum is 15
    d) Finally add value from step a and step c. which means the calc measure value should be = 75
    I need to perform all this logic in MDX. I was able to successfully get step a and b in separate calc measure, however i am not sure how to limit the scope based on certain date criteria. In this case it's, date> Max date(9/30/2014) . Also how should
    i add calculated members and regular members?
    I was able to get max value of C based on date and max date to limit the scope.
    CREATE MEMBER CURRENTCUBE.[Measures].[LatestC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN*[Measures].[C]),1).ITEM(0) ,visible=1;
    CREATE MEMBER CURRENTCUBE.[Measures].[MaxDateofC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN,[Measures].[C]),1).ITEM(0).MemberValue ,visible=1;
    Please help with Scope statement to limit the aggregation of A+B for dates > MaxDateofC? Also further how to add this aggregation value to LatestC calc measure?
    Thank You

    Hi Peddi,
    I gave TRUNC to both of the dates. But still the same issue. I think the problem is in returning the BolbDomain.
    return blobDomain;
    } catch (XDOException xdoe) {
    System.out.println("Exception in XDO :");
    throw new OAException("Exception in XDO : "+xdoe.getMessage());
    catch (SQLException sqle) {
    System.out.println("Exception in SQL :");
    throw new OAException("SQL Exception : "+sqle.getMessage());
    catch (OAException e) {
    System.out.println("Exception in OA :");
    throw new OAException("Unexpected Error :: " +e.getMessage());
    Thanks and Regards,
    Myvizhi

  • How to get the max value of a set of percentage values?

    Hi,
    I've tried to get the max and min value of a set of calculated percentage values. Such as
    Jan Feb March Apr May Jun    Min  Average   Max
    0,5 0,8  1,1      0,4 1      0,6     0,4   0,7         1,1
    The average value works fine. But with "min" and "max" I have a problem.
    I've tried to get the value with the following ways:
    - Create a new calc. keyfigure and make a sum of all values: (Jan + Feb + ...) and set the calculation in key figure properties to Min/Max.
    - Create a new calc. keyfigure and make a sum of all values and set the aggregation to Min/Max
    - Create a selected keyfigure with a filter to the necessary periods and set a calculation to Min (Aggregation is not possible here)
    - Create a new cal. keyfigure with all periods and the function Min. e.g. min(Jan, (min Feb, (min (....)
    None of this solutions provides the right min and max value. When I use an amount value (e.g. Euro) instead of these percentage values the keyfigure with the min and max function works. The others all provide wrong values.
    Is there a solution to get the right min and max value???
    It would be a great help when you have any hints.
    Thanks
    Claudia

    Hi Aduri,
    thanks for your answer but your solution doesn't work.
    The problem is that the periods are defined in a structure with offsets such as
    - period-11
    - period-10
    - period
    in this structure elements there is also the keyfigure "netvalue" defined.
    In the rows of the report there is another characteristic such as company code.
    Is there a solution to find the max and min values of the period values for each company code? Or must I change the data model e.g. copy the keyfigure and make a new keyfigure with another aggregation level?
    Thanks for any hints!
    Claudia

  • Problem to get max string value

    Hi
    my problem is i don't get correct result when i get max string value from my table. for example, it returns '9' as max value while i have some bigger string values like 73, 80,65, ...
    i found
    some solutions to handle this problem (like converting to char or adding some zero in the begining of my value) but it does not appropriate for my situation because my string value maybe everything (some of my customers can use numbers while some other
    else can use alphabetical+numbers)!.
    can anybody help me ?
    thanks in advance
    http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx

    When I see NVARCHAR(50)(50) I am pretty sure the data was declared by an ACCESS programmer who has no idea what he is doing. Do you really have first
    and last names that need fifty UNICODE characters ?  You will get them!  If you invite garbage data, it will come. The USPS uses VARCHAR(20) for names; this has to do with the size of mailing labels and the fact
    that Latin-1 is required by ISO in ALL languages. 
    lease read the  "Stairway to Data" series and pay attention to last sections on the design of encoding schemes. What you have is useless and dangerous because it has no data integrity.  Tag
    numbers (learn what that means, please) need a regular expression and I like to have a check digit. My first guess, without an specs is that you need something like this:  
    patient _case_nbr CHAR() NOT NULL PRIMARY KEY
     CHECK (patient _case_nbr 
      LIKE '[ ABC][0-9][0-9][0-9][0-9][0-9]')
    Fixed length for the forms and display, characters limtied to the Latin-1 Unicode set, and easy to sort. 
     http://www.sqlservercentral.com/articles/Database+Design/72612/)
    --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

  • About get value .

    i have two inputFields named input1 and input2.
      i'v binded context to them:
               myNode.A to input1;
               myNode.B to input2;
    put value to input1:
    <b>
        ISimpleTypeModifiable type = null;
        IModifiableSimpleValueSet values=null;
         type =wdThis.wdGetAPI().getContext().getModifiableTypeOf("myNode.A");
         values = type.getSVServices().getModifiableSimpleValueSet();
         for (int j = 0; j < myDateList.size(); j++) {   //myDateList is a ArrayList.which save my DTO .
          MyDto dto = (MyDto) myDateList.get(j);
          values.put( (String)dto.getA(),(String)myDateList.getB());
    }</b>
      <u>when i select a record from input1' popup.i hope put its key  to input1,put its value to input2.</u>
       how to resolve it?

    Hi,
    Remove the IModifiableSimpleValueSet declared in the code that u have written.
    <i>IModifiableSimpleValueSet values=null;</i>
    Declare this as below.
    Do the below code in implementation
    //@@begin others
    private static IModifiableSimpleValueSet valueSet = null;
    //@@end
    U should declare it globally to the view controller. Change the object values to valueset in all ur code.
    -Nagarajan.
    Message was edited by: Nagarajan Kumarappan

Maybe you are looking for

  • [newbie qn] script runs under Script Editor but not as application

    I have a simple script that runs successfully under the Script Editor. The script is: tell application "Safari" activate tell (make new document) to set URL to "http://www.google.com" end tell However, when I tried to run it as an application, I enco

  • Problem using a conditional suppress in a cross-tab ?

    is there a problem using a conditional suppress in a cross-tab on a row  or summarized field  in crystal XI? I am using the following conditional suppress on a summarized field and its rows          If {@SortCode}=4 then true; Sortcode is a group sor

  • Exchange 2010: How to renew an SSL certificate?

    Hi all.  I have done some reading but it seems I can't find just a simple step-by-step on how to renew an SSL certificate issued by a 3rd party CA for Exchange 2010.  I really don't want to mess this one up by cobbling together partial answers from v

  • Trying to export to DReamweaver getting a Stack overrun error.

    I have created a multiple InDesign file book. I previuosly exported the contents of one document to dreamweaver and it created the text and images all very well so that my webmaster could use the raw spec infomation to input to a data base for our ne

  • When trying to share a photo via email, recipeint says nothing is attached

    We regularly email photos from iphoto to friends and clients, some who have mac's and some who have PC's.  However lately, the people with Macs, with the latest iphoto and iphoto update, say they are getting the emails with photos attached but those