Using mod in the calculation

experts
810312301234X
I need to calculate the x value in the above field .
logic is as shown below.
First we need to add all the odd numbers starting from left ie in our above example it is 4 because x we should not consider so first number is 4.
var1 = sum of odd(42023+1)  = 10
First we need to add all the even numbers starting from left  here in our case 3 is the first even number and x we should not consider.
var2 = sum of even(31310+8) = 16
var3 = var13 + var2  = 103 + 16 = 46
finally we need to take the mod value ie the remainder and that is our desired value X.
var4 = mod(var3/10) = mod(46/10) = 6
x= var4 = 6
Now please tell me how to do this easily in sap ie how to calculate this.
thank you for the replies.

Hi Shiva,
Check this logic.
DATA: varx TYPE c LENGTH 10 VALUE '12345x',
      var1 TYPE I,
      var2 TYPE I,
      var3 TYPE I,
      cnt TYPE I,
      mod1 TYPE I,
      x TYPE I.
cnt = STRLEN( varx ) - 1.
DO cnt TIMES.
  mod1 = var2 mod 2.
  IF mod1 eq 0. " for even numbers
  var1 = varx+var2(1) + var1.
  ELSE. " for odd numbers
  var3 = varx+var2(1) + var3.
  ENDIF.
var2 = var2 + 1.
ENDDO.
x =  ( ( var3 * 3 ) + var1 )  mod 10.
Regards,
Swarna Munukoti

Similar Messages

  • Use Period member in Calculation

    I have a Hyperion Financial Report which has members in the Period dimension as Jan, Feb, March, etc. In my report, I need to make a calculation based on this month, for eg., If Month = May (I need the number of the month which is 5). For example, lets say I need to divide 12 over the current month number (12 / 5 <-Month number of May). So I need to convert the Month members to the appropriate numbers as Jan=1, Feb=2, Mar=3 and so on some how, and then use it in the calculation. How can this be achieved in Financial Reporting, if at all?
    Edited by: 969915 on Nov 6, 2012 5:36 PM

    Hi
    I agree with the previous post, you should look to do this in the underlying database (Essbase?) but unlike the previous post I think you only need 1 account.
    This is the way that Oracle did it for Capex and Workforce planning modules:
    - Create a dyn calc account called TP-Index
    - Set the formula to be:
    IF (@ISMBR(Jan)) 1;
    ELSEIF (@ISMBR(Feb)) 2;
    ELSEIF (@ISMBR(Mar)) 3;
    etc
    ELSEIF (@ISMBR(Dec)) 12;
    If you need a calendar and fiscal TP-Index then create a second account, e.g. if your year end is Mar then Apr=1, May=2 etc on the fiscal while the calendar remains Jan=1, Feb=2
    I use this a lot! If you are looking to do run-rate calculations as your example of how you want to use this for May suggests then you could look to put that in the database as well (depending upon how many accounts you need to do that for). Generally speaking it is quicker to have a dyn calc in the database and simply retrieve the results than to have lots of formulae on the report.
    Hope this helps
    Stuart

  • "Totals calculation issue" when I filter member used in an scope calculation with descendant aggregation

    Hello everybody
    I have a Geography dimension (Country -> State -> City) and 2 related Fact Tables: "Revenues" (with measure Revenue) and "Revenue Goal" (with measure Revenue Goal)  and  created a dummy measure into the Revenue Fact table
    (in the dsv) to calculate the Revenue not planed (by city) using Scope.
    The calculated measure "NotPlannedRevenue" is defined using a Dummy measure on the Revenue FacTable with null like default value, later using Scope I have calculated the values in order to get correctly Totals Values over the a Geography hierarchy
    which is working properly. The MDX script for the measure is 
    SCOPE([Measures].[NotPlannedRevenue]);
    SCOPE ([Geography].[GeoHier].[City].Members);
    THIS=iif([Measures].[Revenue Goal]=0 , [Measures].[Revenue] ,0 );
    END SCOPE;
    SCOPE( [Geography].City.[All]);
    This =sum( Descendants([Geography].[GeoHier].CurrentMember,,LEAVES),[Measures].[NotPlannedRevenue]);
    END SCOPE;
    SCOPE( [Geography].State.[All]);
    This =sum( Descendants([Geography].[GeoHier].CurrentMember,,LEAVES),[Measures].[NotPlannedRevenue]);
    END SCOPE;
    END SCOPE;
    When I check the data,  I get "Totals" well calculated.
    The issue is when I filter Cities from the Geography dimension, the total values are not being calculated using only the selected cities. I have problems in the totals by City, State, Country.
    The total for the State "Karnatak" must by "0" and the grand total must be "10".
    Please someone could help me to solve the way which I must write this MDX or maybe I have to use another strategy.
    Thanks in advanced.
    Gelder de la Ossa

    You shouldn't need the second and third SCOPE statements (on the All members of City and Country) if the first one has been configured correctly - what happens if you remove them?
    Chris
    Check out my MS BI blog I also do
    SSAS, PowerPivot, MDX and DAX consultancy
    and run public SQL Server and BI training courses in the UK

  • HT2492 How do I use the calculator widget in another window?

    How do I use the calculator widget in another window?  For ex: if I want to move the calculator to a window that shows prices of products on a web page.  I used to be able to click on the calculator and use it in another window, before I upgraded to OSX. What am i doing wrong?

    I think you have to bring it back up in widgets in a new window, you can set up a hot corner to make tis qciker

  • HT204291 My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).  My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple

    My iPad 4 does not show up on my TV screen when in AirPlay mirroring mode using WiFi.  The iPad displays AirPlay set to TV with the Mirroring On (green).
    My iPad IOS software is 8.2 and my Apple TV software is at 7.1.  The TV displays the Apple Menu.  The “Settings” does however displays the General menu allowing me to see:
    Apple software:          7.1 (7003)
    Apple TV:                   Model No. A1464, Part No. MD199B/A
    Signal Strength shows 5 circles.
    It does not display the iPad screen but when I use the BT Sport App I can hear the sound but there is no video.  I have searched the internet for a solution to no avail. The problem first arose when the IOS was at 8.1+ but it worked correctly briefly when I updated to IOS 8.2.  Can you help please?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.
    If you are still having problems, the following article(s) may help you.
    Troubleshooting AirPlay
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Wifi Diagnostic Software (for Mac users)
    You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.
    When making adjustments to your network for better optimisation, you may find some of the points mentioned on this page helpful.

  • I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.  I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion.

    I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.
    I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion. I now want to fix the underlying problem.
    I'm not running any weird background processes and in my energy saver settings I've tagged "put the hard disk to sleep when possible:, "allow power button to put computer to sleep" and "automatically reduce brigthness". All pretty standard.
    Is there anyone who can give me some pointers ?

    Today I solved the same problem for my iMac running Snow Leopard. See https://discussions.apple.com/thread/3008791#15947706. The method may help you, too.
    For me it was the DynDNS Updater preventing my iMac from automatically entering sleep mode.
    To my knowledge the cause of this sleep problem can only be a peripheral device or a process. So I suggest to first unplug all peripherals and test whether that's the cause. If not, I suggest to terminate one process after another and to test automatic entering of sleep mode after each. Start with user processes; continue with system process if necessary.
    At least that's the way I found the offending process. Fortunately, I was able to change the configuration of that process to allow again automatic entering of sleep mode.
    Good luck!

  • How to use the Calculated attibute in view object

    Hi,
    I have a view object query with the calculated attribute name as 'TRANCODE' in the below sql.This query works for the initial page loading.
    After the page gets loaded, there is a search section in the same page at the top.
    Here i will have to build the whereclause to the same query and retrieve the values.
    i am using jDeveloper 10.1.3.1, with adf and jHeadstart.
    Can some one tell as how to use the calculated attribute TRANCODE in whereclause?
    SELECT /*+ first_rows(10) */
    BatchCntl.FILE_CNTL_ID,
    CASE WHEN chk_bit(Entry.ENTRY_FLAGS, 2)='Y' OR Entry.ENTRY_SUBSTATUS = 'D' OR Entry.ENTRY_SUBSTATUS = 'J'
    THEN
    CASE eeh.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE eeh.TRAN_CODE
    END
    ELSE
    CASE Entry.TRAN_CODE
    WHEN '21' THEN 'C'
    WHEN '22' THEN 'C'
    WHEN '31' THEN 'C'
    WHEN '32' THEN 'C'
    WHEN '26' THEN 'D'
    WHEN '27' THEN 'D'
    WHEN '36' THEN 'D'
    WHEN '37' THEN 'D'
    ELSE Entry.TRAN_CODE
    END
    END AS TRANCODE,
    FROM Batch_Cntl BatchCntl, Entry, ENTRY_EDIT_HIST eeh
    WHERE (BatchCntl.BATCH_TYPE = 'E')
    AND (BatchCntl.BATCH_STATUS in ('A','D','R','P'))
    AND entry.in_batch_cntl_id = BatchCntl.BATCH_CNTL_ID
    and Entry.fi_rt = eeh.fi_rt (+)
    and Entry.entry_id = eeh.entry_id (+)
    AND (Entry.ENTRY_STATUS in ('A','D','R','P'))
    ORDER BY BatchCntl.BATCH_CNTL_ID, Entry.entry_id
    regards
    Raj.

    Let's say your application module is com.yourcompany.someapp.services.MyService, and let's say you authored a method like the following in the MyServiceImpl.java file:
      public void doSomething(int i, String s) {
      }and you exposed this AM custom method using the AM editor.
    BC4J design time will automatically create you the com.yourcompany.someapp.services.common.MyService interface that will look like this if you go look at the source code:
    package com.yourcompany.someapp.services.common;
    import oracle.jbo.ApplicationModule;
    public interface MyService extends ApplicationModule {
      public void doSomething(int i, String s);
    }To use your custom method from a client, just cast your ApplicationModule to your custom interface like this:
    import com.yourcompany.someapp.services.common.MyService;
      MyService mySvc = (MyService)yourAM;
      mySvc.doSomething(1,"foo");

  • How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    How can you turn off the braille setting on an iPhone 4s, once on it won't let you slide the phone into use mode to change the settings or do anything?

    An alternate method is Accessibility Settings when connected to iTunes. You should be able to turn it off there. I would also check out some of the answers listed to the right of this post and see if they can help.

  • I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
    -Kevin P.
    Message Edited by Kevin Price on 12-01-2006 02:42 PM
    Attachments:
    Binning example.vi ‏51 KB
    Binning example.png ‏12 KB

  • Using a "Posting Key" relevant for the calculation of sales

    Hi All,
    if I make a posting by F-02 using a "Posting Key" relevant for the calculation of sales, I wonder: in which table SAP registers the data of sales?
    Is there the way to modify the relevance for sales of that posting?
    Thanks

    Hi
    As far I know, sales figures are getting updated in the following summary tables:
    KCN1 for Customer related.
    LFC1 For Vendor realted.
    Regards

  • Can someone make iBooks have the Option to view 2 pages in landscape mode so it can use up all the pixel real estate?

    Can someone make iBooks have the Option to view 2 pages in landscape mode so it can use up all the pixel real estate?
    Apple usually does this for OSX and its great when compared to windows where it doesnt use up all the real estate for viewing applications like websites and pdf files but when it comes to iBooks, it feels like there is no apple touch to it and is limited.
    If steve jobs were still alive, i bet there wouldnt be this problem >.>
    Please consider this as a real problem for people out there who would like to see 2 pages in landscape mode with pdf files and not just epub files.
    Thanks!

    Penguin, do you always insult people on here or was I just a special case?
    If you read the statement carefully, which you obviously did not! I was speculating, and I did not say anything for certain about knowing or not knowing ...
    I'm happy for the reply to the post and helpful link you posted to where I can leave some feedback for my post on an Apple monitored site but i rather you not reply if your gonna leave a snyde remark with every helpful comment.
    Don't do it again. and Thanks for the help.

  • I use lightroom with the soft proofing feature for my printing. I used to make a copy proof, but all of the sudden something changed, and even if I'm on the copy in the developing mode it prints the original. Also, If i chose a file that was already in li

    I use lightroom with the soft proofing feature for my printing. I used to make a copy proof, but all of the sudden something changed, and even if I'm on the copy in the developing mode it prints the original. Also, If i chose a file that was already in light room to print, even though I have the chosen file up in the developing mode, it will instead print the most recent file that I added to lightroom. If found a way to work around these problems, (check make this the copy in the soft proofing, and copy my settings and delete and reload the old files) but it's a slight hassle and it didn't use to do this. Not sure why it changed. Could I have accidentally changed a setting?

    See
    iOS: Device not recognized in iTunes for Windows
    - I would start with
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or              
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    However, after your remove the Apple software components also remove the iCloud Control Panel via Windows Programs and Features app in the Window Control Panel. Then reinstall all the Apple software components
    - Then do the other actions of:
    iOS: Device not recognized in iTunes for Windows
    paying special attention to item #5
    - New cable and different USB port
    - Run this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Also see:
    iPod not recognised by windows iTunes
    Troubleshooting issues with iTunes for Windows updates
    - Try on another computer to help determine if computer or iPod problem

  • TS1702 Cannot get iPhone 4 to talk with Mac Lion using Numpad. Have updated, restarted etc. Have Screen Sharing on. It sees my computer but when I press keys on the NumPad there is no response. I have tried it on the Calculator and on Sibelius. Any clues?

    Cannot get iPhone 4 to talk with Mac Lion using Numpad. Have updated, restarted etc. Have Screen Sharing on. It sees my computer but when I press keys on the NumPad there is no response. I have tried it on the Calculator and on Sibelius. Any clues??

    Here's how to do it.
    1. App Store, iTunes Store should have the same AppleID on Computer and iPhones. (Free to share apps, music and books... )
    2. Person A uses the same purchasing account for everything (ie. email, contacts and ...).
    3. Person B have the same purchase account see no. 1 (for App Store and iTunes Store) but create a second AppleID for iCal, e-mail, contacts  and etc.

  • Bottom row of the keyboard is not working in a vertical orientation on the iPhone 3Gs. the "slide to unlock" and all keys on the calculator on both orientation works fine. I can use the keyboard on horizontal orientation.

    Bottom row of the keyboard is not working in a vertical orientation on the iPhone 3Gs. the "slide to unlock" and all keys on the calculator on both orientation works fine. I can use the keyboard on horizontal orientation. The tabs on bottom of all apps also work fine.
    I have already tried holding down the power button and home button for 10 seconds, but no difference.

    I've had this problem on and off for the last few weeks (around, but not directly related, to upgrade to 6.1...can't remember if was before or after)....I'm very convinced it's a software problem (as there have been times when the bottom row works perfectly, without any need to "press" differently or anything).
    However, it seems to be a rather resilient software issue, as a full restore does not consistently fix it, and it applies to more than just the keyboard; if I open a drawing app, there's definitely a row (about 4mm up from the edge of the screen closest to home button) where I cannot draw.
    It's happened 4 times now.  Originally it went away with a restore from backup, then worked for 2 more days.  The second and third times, it went away with a full restore (although I did two full restores in between those two restores that did nothing, so restore didn't consistently fix it)....and it seemed to return in the most random of circumstances. 
    I paid very close attention to what apps I was using the last time it was working so that I could spot which app, if any, might be causing the issue.  I deleted several apps, I stopped using the games and many other apps.   I only used three apps between it working fine and starting up as a problem again: mail, safari and messages.
    I was convinced it was mail, as it happened this morning when I picked up my phone off the bedside table to respond to a new email.  It was working when I went to bed.  I picked up the phone when it buzzed, hit the email app, hit reply and started to type....**** bottom row wasn't working again.
    However, tonight I did 2 things....one of them worked because it went back to normal (sorry, I don't know which as I was exasperated and trying a number of things). 
    The two things I did between a broken keyboard and a working keyboard were:
    1) adding a second keyboard (English(Canada)), changing to this keyboard, and changing back
    2) disabling Siri...and then turning it back on...and then disabling Siri's "Raise to Speak"
    In retrospect, I wonder if it actually was the "Raise to Speak" that was putting the phone into a weird state, and might explain why the phone would just "suddenly" start behaving strangely when I picked it up.  Of note, the "raise to speak" hasn't actually triggered Siri to come on in months anyway.
    Regardless, the keyboard is back to normal now...and I'm just going to leave "Raise to Speak" off.  I've put the keyboard back to just "English" with no alternates and Siri remains on otherwise without issue.

  • Using Safari on the iPad unsupported mode with R17

    I have a customer that just purchased iPad's for their sales force and they are trying to use the "Safari" or "Private Browser" in an unsupported mode. They have turned off the message center, but when they try and login after clicking through the unsupported browser message they receive the following error:
    Occam Browser Update Servlet: Uncaught exception: and uncaught exception has occurred while attempting to render the page. Please try again later or contact Customer Care for more information.
    I know we have customers and internal sales consultants that have CRM OD working on the iPad with the message center turned off. Has anyone seen this error when attempting to login with the iPad or iPhone?
    Thanks for your help!

    Support for CRM On Demand using Safari on the iPad will be available in R19.

Maybe you are looking for