Formula totals not working

These add up correctly:
Two formulas Adding Up
WhilePrintingRecords;
Global NumberVar GrossCededEarn ;
if {@ThisLineNo} = "112" OR {@ThisLineNo} = "122" then
GrossCededEarn := GrossCededEarn + {@SECTION-SIGNED-AMOUNT};
WhilePrintingRecords;
Global NumberVar GrossPremEarn ;
if {@ThisLineNo} = "110" OR {@ThisLineNo} = "120" then
GrossPremEarn := GrossPremEarn + {@SECTION-SIGNED-AMOUNT};
Two formulas displaying:
global numbervar GrossPremEarn;
if {@Breaks} = "A2" then GrossPremEarn
global numbervar GrossCededEarn;
if {@Breaks} = "A2" then GrossCededEarn
But this does not work:
WhilePrintingRecords;
Global NumberVar NetAcqDAC ;
if ({@ThisLineNo} >= "150" and {@ThisLineNo} <= "151") then
NetAcqDAC := NetAcqDAC + {@SECTION-SIGNED-AMOUNT} ;
WhilePrintingRecords;
Global NumberVar NetAcqDAC2 ;
if ({@ThisLineNo} >= "160" and {@ThisLineNo} <= "162") then
NetAcqDAC2 := NetAcqDAC2 + {@SECTION-SIGNED-AMOUNT};
WhilePrintingRecords;
Global NumberVar NetAcqDAC3 ;
if {@ThisLineNo} = "190" then
NetAcqDAC3 := NetAcqDAC3 + {@SECTION-SIGNED-AMOUNT};
global numbervar NetAcqDac;
global numbervar NetAcqDac2;
global numbervar NetAcqDac3;
if {@Breaks} = "B5" then  totext(NetAcqDac) + "  " + totext(NetAcqDac2)+ "   " + totext(NetAcqDac3)
The only sum that works here is te NetAcqDAC3 which happens to be the line right before I display these totals.
The other two show totals but they are completely wrong.  When I look in the detail where I placed them they all add up correctly but when I display them they are wrong.
I also created a running total which I noticed it resets for each {@ThisLineNo} but I have it set to never reset.  Also I have this running  total evaluating with this formula:
({@ThisLineNo} >= "150" and {@ThisLineNo} <= "190")
I donu2019t understand why it works for the first set above but it wonu2019t for these.
Help Please!
JC
Edited by: J S on Mar 12, 2009 12:43 PM

Hi J.S,
Common thing in below two formulas is checking a text field with >= otherwise there is no problem.  Try the following :
WhilePrintingRecords;
Global NumberVar NetAcqDAC ;
if (ToNumber({@ThisLineNo}) >= 150 and Tonumber({@ThisLineNo}) <= 151) then
NetAcqDAC := NetAcqDAC + {@SECTION-SIGNED-AMOUNT} ;
WhilePrintingRecords;
Global NumberVar NetAcqDAC2 ;
if (Tonumber({@ThisLineNo}) >= 160 and Tonumber({@ThisLineNo}) <= 162) then
NetAcqDAC2 := NetAcqDAC2 + {@SECTION-SIGNED-AMOUNT};
Thanks,
Sastry

Similar Messages

  • Formula is not working for key figures (  cumulative )

    hI
    I have  Qty A and qty B key figures  and changed property to cumulative in query designer . two key figures are working fine . I ahve another key figure which is formula ( Qty A + Qty B) .
    Issue is
    Formula ( Qty A + Qty B) is showing before cumulative values result . it is not showing cumulative total .
    Ex :  
                       Before cumulation prperty for Qty A and Qty B
                          Qty A       Qty B         Total ( formula ( Qty A+ Qty B)
                            10            20                  30
                             8              7                    15
        After changing propert cumulative in query designer for Qty A and Qty B
                         Qty A       Qty B           Total ( Formula 9Qty A + Qty B)
                           10            20                30
                            18           27                 15 ( still it is show 15 like above example means formula is not working on cumulative values)
    Formula is working on before cumulative value . it  is not taking cumulative values.
    Please helo to resolve this issue . I think I need to change some prperty in query designer.
    Appriciate your response.
    Thanks
    Rohan

    Hi
    Problem solved .
    Thanks
    Sree

  • Adobe Edge Animate CC 2014.1  is totally not working. It stop working after 5min. Sometimes is stops the operating system.

    Adobe Edge Animate CC 2014.1  is totally not working. It stop working after 5min. Sometimes is stops the operating system. On on mac OS X Yosemite. macbook pro i7 2013.
    I reinstalled it not helping.
    Message was edited by: Daniel Boguszewski

    UPDATE
    i have ulpaded 2 animation ( one normal and one Responsive ) in 2 different server here the link
    www.eclipseadv.com/maliRP/maliRP.html
    Untitled
    via SAFARI or CHROME on MAC all OK
    but via IPAD ( SAFARI, CHROME and MERCURY) i didn't see the video, just the animation of the BUTTON  and the link if i click on it (not in Mercury), like in the content viewer.

  • Grand Total Not working on Materialized view based table ??

    Hi all,
    I have a complex report report by using sum and decode function. I precalculated my requirment in database and then create a materialized view based on my sql statement. I import this view in physical and BM model and its results very fine and efficient. But the problem create when I implement Grand Total on my report in table view it did'nt work means (Grand Total is not working on this MV based table) Any idea why ??
    any reply would by higly appriciated.
    Regards

    Hi Zishan,
    Check the Aggregation Rule and set it to sum in the table view.
    That is go to the "edit formula" tab of the column for which you want grand total and set that to sum.
    Hope this will help.
    Thanks
    Ashok

  • BEx formula change not working in existing Analysis for Olap/Analysis for Excel reports

    Hello all,
    I posted this in Analysis for OLAP, but there has been no response so I'm hoping perhaps you BEx experts can help me.
    I had to modify a formula in a Bex query to have it calculate the results of the formula by summation.
    I checked the query using BEx Analyzer and it summed correctly.  If I create a new analysis for olap report, it sums correctly.
    If I modify an existing report, it does not pick up the change.  Existing Analysis for Excel reports also do not pick up the new summary calculation.
    Using the CMC, I edited the connection and reselected the Bex query, but that did not work either.
    Here it is working in the query:
    Line Discount is a formula with logic checking to see if "product list price total amount" is 0, set the line discount to 0; otherwise calculate it as "product list price total amount" - Net Sale.  So the total needs to sum of the line discounts (0+2820+2820 = 5640) and not be the Overall result "product list price total amount" - Overall Result "net sale" (13960-96720= -82760).
    Here it is in an existing Webi report - working:
    Here is what is happening in an existing Analysis for OLAP report - not working:
    I also tried to unselect Line Discount as a key figure from the existing report and reselect it, but that did not work.
    I'd like to find a solution so that all the reports that use this query won't have to be rewritten.
    I'm on BW 7.0 EP 1 SP 10 and BI 4.0 SP7 Patch 5.
    Thank you for your help,
    Susan

    Hi,
    Apply Exception aggregation on line discount formula--Exception aggregation as Total---Reference characteristic as Promega product.
    Make sure to refresh the webi report once after the changes has been done.
    If this does not work then you can apply summation calculation for that column at webi level as well.
    Regards,
    AL

  • Formula calculation not work, when one inspection characteristic was set by formula

    In the inspection plan, set 0040 charac. "calc. charac." in control indicators, and the formula is "15.86/C0020*100".
    when the inspection lot was created, the 0040 charac. could be edit, and the formula title  "formula calculation not by SAP interpreter".
    However by the same basic data in QAS system,the formula title is "formula calculation by SAP interpreter", and the charac. couldnot be edit, only be claculated by the system.
    Anybody know why this error occurred?
    this  is the question in PRD system,
    this is the right situation in QAS system

    Hi Pei,
    Please can you check the characteristic value using C00020 (C0 then 2 zeros before 20. Total 3 zeros before 20) instead of C0020 and check if this is working.
    You can take some clues form the below thread -
    http://scn.sap.com/thread/1672782
    Thanks to all previous contributors of the attached thread!!
    Thanks,
    Arijit

  • Formula is not working in report

    Hi Friends,
    This is formula iam using in report.but in output iam getting only value 1.
    Iam not getting other values. I think my OR condition is not working.
    ( ( ( ( ( 'KF1' < 0.1000 ) * 1 OR ( ( 'KF1' >= 0.1000 ) AND ( 'KF1' < 0.1200 ) ) * 2 ) OR ( ( 'KF1' >= 0.1200 ) AND ( 'KF1' < 0.1500 ) ) * 3 ) OR ( ( 'KF1' >= 0.1500 ) AND ( 'KF1' < 0.1800 ) ) * 4 ) OR ( 'KF1' >= 0.1800 ) * 5 )
    Iam chenged open and close brackets....but it is not working.
    How to use if condition or else condition in formula?
    How can i get values in output accourding to range?
    Thanks in advance
    Ramu

    Hi Ramu,
    If condition can be used in Formulae like
    Conditional Calculations (IF-THEN-ELSE)
    You can make conditional calculations using Boolean operators An expression in the form
    IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
    <Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>
    Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs
    can be written as the following formula:
    (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs)) * Actual Costs
    or
    (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs
    Please explain your case as its complex ...
    Thanks
    CK

  • Subtotal / Grand total not working

    I am new to OBIEE & I could not get a simple 'Total By' or 'Grand Total' in Answers, Table view. The default aggregation rule in Administrator is selected as 'Sum'. When I click on the 'E' summation icon, nothing happens. What am I missing?
    Thanks,
    Dinesh.

    OK. I figured out what was wrong. I did not put the logical schema in a star schema approach (dimensions & facts). Once I did that, the sub-totals & grand totals started working.
    But I am greatly disappointed by this limitation. I just have a copy of my transactional database & I do not want to do star schema data modelling so that I can quickly start reporting. Is there any work-around for this?
    Thanks,
    Dinesh.

  • Condition on CKF (based on replacement type formula Variable) not working

    Hello Friends,
    We have a reporting requirement where in we want to find out vendors who are being paid with the multiple currancies.For this I have created a replacemnent path formula variable with reference to currancy and created a CKF with the help of this variable.
    Now as I want to display only multiple currancies I want a condition to display value > 1 on this CKF but
    this condition is not working as the replacement path variable contains value 1 for every currancy passed to it although it shows in the report for 2 currancies value as 2.
    Can anyone guide us in this matter?
    Thanks,
    Suyog.

    Friends found the Solution so closing this thread....:)

  • My mbp with retina's camera is totally not working

    My camera is not working at all. I already tried to reinstall mac os x mountain and even restore my mac to factory setting. and i restarted many times but it still doesnt work. Im confused.

    Take it to Apple. The camera must not be installed right. There must be a loose wire. If your positive that it won't work take it to them. Its considered as a defected product!

  • Running Total not working

    Dear all,
    I am creating a new report which needs a conditional running total.
    I need to sum the credits quantity if the following condtions are met
    line_type="S" and
    line_no<3
    I used running total like this
    Field to summarize: lab_credits2.credit_qty
    Type of Summary: SUM
    Evaluate: Use formula
    {lab_credits2.line_type}="S" and
    {lab_credits2.line_no}<3;
    Reset: On change of group (Reason Code).
    When I ran the report, it did not produce the right results, so I placed the line type and line no into the same Group footer and ran the report.
    I found out that the report is not filtering the linetype and line no.
    Result shows
    Line Type ="S" - 100 - Line number =1
    Line Type = "M" - 200 - Line number=6
    and so on.
    The report is grouped by Reason Code.
    Any ideas why would it not be filtering the records?
    Report Record Selection Code
    {lab_credits.credit_date}>={?startdate} and
    {lab_credits.credit_date}<={?enddate} and
    {lab_credits.credit_status} = 2;
    Status=2 is needed there to filter the Order numbers correctly.
    Many thanks
    Regards
    Jehanzeb

    Thanks James,
    I have put all three in detail and used the filteration and it worked under detail section however the results when used in total SUM is produced incorrectly.
    I suspect it might be of database table linkage? or maybe I have done something wrong in the report.
    I am going to create another report and see if that works.
    Will post info here.
    Regards
    Jehanzeb
    Edited by: Jehanzeb Navid on Sep 4, 2008 11:55 AM
    Right I found the issue however I don't know how to resolve it.
    I have 4 tables in the database
    1: Lab Credits - Order_num, Credit_status, Reason_code
    2: Lab Credits2 - Order_num, Line_no, Line_type, Credit_qty
    3: Lab Reasons - Reason_code,Reason_description
    4: Oetrn2 - Order_num
    This is how they are linked up
    Lab_Credits_Order_num = Lab_credits2_order_num and oetrn2_order_num
    Lab_Credits_Reason_code = lab_reasons_reason_Code
    Report Grouping
    Grouped by Reason Code
    Date range - month to date
    Report Record Selection
    {lab_credits.credit_date} in monthtodate and
    {lab_credits2.line_no}<3 and
    {lab_credits2.line_type}="S" and
    {lab_credits.credit_status}=2;
    Now the issue
    When I add sum of qty of lab_credits2_credit_qty into the report Group footer,it produces the right results However when I add
    DistinctCount of Oetrn2_Order_num into the Group footer, it creates totally different Sum of Lab Credit Qty results. (Please note: The oetrn2_order_num results appear fine, however they messup Sum of Lab_credit_credit_qty).
    What do you think where am I doing wrong?
    It has to be something to do with table linkage.
    Regards
    Jehanzeb

  • Totals not working correctly

    I am trying to create a calculation by evaluating a set of records and including only those that meet the criteria in the total. The calculation seems to work correctly on the individual records, but the total does not... it seems to be doubling the result. Here's the calculation:
    SUM(CASE WHEN ( Tx Period."Tx Period Year" = '2007' AND Activity Composite fact.Activity Date <= TO_DATE('07-MAR-2007') ) THEN Activity Composite fact.Activity Amount ELSE 0 END)
    Any help appreciated

    Hi,
    Are there any Page Items on the report?
    Is the report output displayed for all the records? Also, check if "Hide duplicate rows" is checked.
    Thanks.

  • Query level formula is not working for all the amounts

    Hi Friends,
    In my production system I found new thing that in my query level I done some calculation (as per my requirement I done amount devide by 100 to get correct values)
    It is working for all the amounts except 1or 2 amounts, im uploading same source file for  all the amountsu2026 why it is happening like this u2026and is there any availability to change those 1 or 2 values at data base tables level  or at any pleace (I hope in SAP it is may not possible)u2026can any body tell me why it is happening like this. u2026 because of  this issue only my report is pending to sign off u2026.please  can any body find  the solution ASAP.
    Regards,
    VENKAT

    Are they non decimal currencies?
    If yes, create RKF1 on amount field excluding the currencies for which you are not getting currect values then in CKF or formula as RKF1 / 100.   Similarrly create another RKF2 on amount only including the currencies which are excluded in RKF1, create a CKF or formula as RKF2/10000. Then created another formula wich adding CKF1 and CKF2.

  • Formula variable not working.

    Hi BI/BEX experts,
    I am creating an aging report in AP using 2 formula variables. One fomula variable is giving the right value that is on key date but the other formula variable which is on 0BLINE_DATE is not getting replaced. It is givinf X in color red. Thus calculation for number of days is coming as X in red.
    We are using 0BLINE_DATE as a free characteristics. If we use in row, it is working correctly. But we cannot use it in a row as users want a consolidated report on profit center.
    We are sing SAP BW 701, Level 008 SAPKW70108.
    Any help is appreciated.
    Thanks.
    Sheo

    I am having the same issue as Sheo.
    I have Clearing Date (CLEAR_DATE) as a characteristic.
    I have Clearing Date (CLEAR_DATE) in the Rows section
    Created a formula variable based on CLEAR_DATE
    Created a calculated key figure using the formula variable from Step 1
    Put CKF from Step 2 into Columns section
    Run report and everything works fine
    Remove Clearing Date from Rows and the CKF turns into red X
    Also, just like Sheo, if I just change the Clearing Date in the rows to "No Display", there are still extra lines because the Clearing Date is still there, but not displayed.
    Question: Is there a way to have a date (which a characteristic) used in formulas/CKF without it being in the Rows section of Analyzer. Thanks!

  • Formula is not working?

    Hi BW Friends,
    In my Query I have <b>Stock Qty</b>(Basic Key Figure), <b>Release Date</b> and <b>Current d</b>ate.
    Basically <b>Release date</b> is a calculated keyfiure defined using a formula variable(Replacement Path of char Value)
    When I am trying to Introduce another Basic Key figure, the Release Date column displays nothing jut x.
    Please suggest me.
    Thanks,
    Sudhakar

    Hi srini,
    Release date is a formula in columns and defined on formula variable.
    I did not understand about <b>including</b>.
    Pleaase can you calrify me.
    Thanks,
    Sudha

Maybe you are looking for

  • Need help in updating a hierarchy

    I have a table T1 which has the following columns: Emp_ID - varchar Mgr_ID - varchar One EmpID can have only one Mgr ID, One MgrId can have multiple EmpID. Emp_ID can be Mgr_ID for some other Emp_ID. I need to write a code in which I have to edit all

  • How to share the movie library

    My mac is networked with another mac in the house. I want to share my movie library with that mac. So I went to the iTunes Preferences and checked Look for shared libraries and Share my library on my local network. I did the same on the other mac, bu

  • How to put negative time in CAT2 ?

    The client wants to put in negative time values in CAT2. What configuration should I change to make this allowed? Do I need to change the program or user-exit? Thanks a lot.

  • Communicating with ports

    I have a question about developing code that can communicate to a port and therefore someting in the outside world. I see tutorials for doing this for various things but I don't understand how they know what to assign for different "packets" that the

  • Dynamic setting of App.config

    I have App.config in my project. <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="OSConnection" providerName="System.Data.SqlClient" connectionString="data source=My-PC\SQLTEST;initial catalog=productorder;User I