If condition-- mapping

Hi,
I want to print the company description using the following mappings :
0268 = x.
0278 = y.
2706 = z.
how can i do this with this select statements.
select bukrs docdat ntgew brgew anzpk nfnum from J_1BNFDOC
      into corresponding fields of int_output where
     DOCNUM = int_output-docnum.
here,
bukrs is company code.
Pls reply asap.
Stal.

After your select statement,
    You can write the below select to get the company description.
select bukrs butxt
          from t001
          into table i_t001
          for all entries in int_output
          where bukrs = int_output-bukrs.
Once you get the values then you can loop and move the company code description to the final internal table...and you can do the further process.
Thanks,
Srinivas

Similar Messages

  • Conditional Mapping issue - Need help Urgently

    Hi Experts,
    We have a requirement for conditional mapping for HFM. When the value of certain account is positive, it is mapped to one account, else, to a different account. We are able to achieve this in the conditional mapping.
    Once the mapping is done, we need the amount to be positive one. How do we attain this?
    Thanks
    Kannan.

    Hi,
    Lets say your two target accounts are called X & Y.
    I assume in your account mapping you have something like
    Source account xxxx1 ==> Target account X
    Source account yyyy1 ==> Target account Y
    Here is what you can do.
    In the import script of Account you can check the amount value < 0 and assign to account X else to account Y and assign to the out variable.
    In the import script of Amount you can check if the source account is xxxx1 or yyyy1 then always assign abs(amount value) and assign to the out variable.
    In the account mapping,
    If you wish you can retain the below (with the account script change as I suggested, you will never get xxxx1 or yyyy1 in the out variable anymore)
    Source account xxxx1 ==> Target account X
    Source account yyyy1 ==> Target account Y
    And add the two additional entries (since out variable for the two conditions will be X & Y)
    Source account X ==> Target account X
    Source account Y ==> Target account Y
    Hope this helps, we have plenty of these kinds of situtations.
    Regards
    Ajay

  • Conditional mapping in Graphical mapping

    Hi All,
    I have a conditional mapping requirement i.e.I have 2 nodes ( collections/collection/object and  extensions/collection/@name) in the source structres. Both nodes are identical and have unbound occurences. Based on certain condtions I need to map second node in the  source node to target node ( Items ). Below is the condition.
    If first node '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/collections/collection/object/@classname' (Occurs Unbounded ) value is not  'contracts.LineItem'  and second node '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/extensions/collection/@name' ( Occurs Unbounded ) value is 'MATGRP_COLLN' then only map source field '/MT_FCI_CONTRACT_EXPORT/fcidataexport/objects/object/extensions/collection/row' ( occurs unbounded ) to target node 'Items' ( Occurs unbounded ).
    I have done this mapping using If condtions and did some context changes. My second condition is working fine but my first condition is not working as expected. Its only taking value in the first occurences and based on that passing first condition. But I need to check in all occurences whether value 'contracts.LineItem' is not exist  then only I need to pass that condition. Please let me know how to achieve this.
    Please help me to achieve my requirement.Thanks.
    Regards,
    Rajesh

    Hi Rajesh,
    To reply your query first we have to understand the exact requirement . So I am writing my understanding below and solution for it .Kindly reply if your requirement is different.
    you have three source field which is involved in mapping .@classname, @name, and row and target side you have node item .
    Now you have to check for all classname and name that if classname is not equal to contracts.LineItem and @name is equal to MATGRP_COLLN ( both the values I have considered as constant) then map row to target node item. i.e if classname and lineitem is occuring 4 time and two time both are satisfying both the codition then generate two target Item node .
    Solution.
    classname -> (CollapseContext)->equals to ContractLineitem --not -->
                                                                                    AND -
    IIF WITHOUT ELSE
    Name -
    >(CollapseContext)-->equals to MATGRP_COLLN--
    >
    the condition of if without else function will be output of AND and in then map row----.(collpasecontext) finally the output of if without else will be mapped to item
    note :all ittalic is Graphical mapping functions .
    Regards,
    Saurabh

  • Conditional Mapping with script using BlOCKPROC to access the HFM API

    Hello,
    following problem. During the mapping/validation I need to map certain custom1 members to None if the Top Member is None and let it be if not None. This allocation depends on the account. Reading through the documentation I stumbled across conditional mapping.
    So in the Custom1 map type Like I defined following:
    Rule Name: C1_Script
    Rule Definition: CXXX*
    TargetCustom1: #Script
    In the script I try to achieve to get the Custom1 Top member for the account! The HFM API offers this function(fGetCustomTopMember) and with varValue(14) I get my TargetAccount. So everything I need seems to be there.
    Only problem is I need to use the BlOCKPROC to access the HFM API provided through the adapter, but either way won't work.
    Trying "Set API.IntBlockMgr.IntegrationMgr.PobjIntegrate = BlOCKPROC.ActConnect("LookUP")" throws an object required error.
    Trying
    Dim BLOCKPROC
    Set BLOCKPROC = CreateObject("upsWBlockProcessorDM.clsBlockProcessor")
    BLOCKPROC.Initialize API, SCRIPTENG
    throws me a type mismatch for "BLOCKPROC.Initialize".
    I am kinda at my wits end. Any help/clue is much appreciated.
    Ahh, yes the different writing BlOCKPROC and BLOCKPROC is correct!
    Thanks!

    Hello Tony,
    Many thanks for your answer. Just one last question. The event AftProcMap(strLoc, strDim) gives me the Dimension? Just how do I get the account?
    Can you point me to the right direction and I'll figure out the rest!
    Thanks a lot!

  • Using conditional Maps

    Hi all, Im using FDM 11.1.2.1
    I want to use a conditional Mapping for Custom 2 (UD2)
    I tried to use the example on the manual, but on the field Rule Definition, which is empty on the example, FDM is forcing me to include some value, so basically the grid is as follows
    Rule Name Rule Desc Rule Definition Targe Custom2 Script
    NIT All All #Script ----
    And the script goes like this
    If Len (varValues(21)) > 9 Then
         Result = Left(varValues(21),9)
    Else
         Result = varValues(21)
    End If
    Once I execute the import the follow error comes up
    ERROR:
    Code............................................. 4026
    Description...................................... Invalid Between Clause: (All) For Dimension Map (UD2) and Rule (NIT)
    Procedure........................................ clsCalcEngine.fFlagWildcard
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 11124
    I can´t understand what's wrong with the rule, if it's on the script, or the grid.
    Please any help will be highly apprecited

    If you want the map to apply to all Custom2s, then I think it is more appropriate to use Like mapping instead of Between mapping. In the Like mapping entry, the Rule Def ashould be set to * (asterisk) and the Target should be set to #SCRIPT.
    Edited by: Larry R on Nov 23, 2011 12:30 PM

  • FDM 11.1.2.1 Mapping Issue Conditional Mapping Error

    I am configuring the newly installed FDM 11.1.2.1 and have and issue with the conditional account mapping where I have "varValues(9)" and it comes with this error. I have taken the script from our current FDM 9.3 versionm where it did worked, but in FDM 11.1.2.1 it will no go through.
    Is the script not correct ? Or is this new version different somewhere ?
    Thanks,
    Henri
    Error message
    ** Begin FDM Runtime Error Log Entry [2011-10-05 16:25:41] **
    ERROR:
    Code............................................. 13
    Description...................................... Conditional Map Script Error: Type mismatch at line(1)
    Script:
    If varValues(9) = 0 Then Result = "5821.11.060" Else Result = "5821.11.060" End If
    Rule=w98x
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 5000
    IDENTIFICATION:
    User............................................. <withheld>
    Computer Name.................................... <withheld>
    App Name......................................... <withheld>
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... SQLOLEDB
    Data Server...................................... <withheld>
    Database Name.................................... <withheld>
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... <withheld>
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... Actuals - PP
    Category ID...................................... 13
    Period........................................... Sep - 2011
    Period ID........................................ 9/30/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False

    Cast the value of varValues(9) as a Double and do the same for the 0 i.e. CDbl(varValues(9)) = CDbl(0). Also verify that the value passed in varValues(9) is actually a number and does not contain non-numeric characters or is blank

  • FDM Conditional Map Script Error

    Hi all,
    we trying importing data from EBS to HFM though ERPI by using FDM.
    We used conditional based scripts to importing data from ebs to FDM.
    this scripts used in FDM for ICP dimension between conditional mapping script.script logic is some particular account are related to Intercomapny transaction accounts we have to map to ICP member
    can anyone help me on this:
    this is error :
    ** Begin FDM Runtime Error Log Entry [2011-12-12 15:10:18] **
    ERROR:
    Code............................................. 1014
    Description...................................... Conditional Map Script Error: Expected 'End' at line(2)
    Script:
    If varValues(14)="113401" Then Result="21_ADNIP"
    Else Result="[ICP NONE]"
    End if
    Rule=I1
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 13888
    IDENTIFICATION:
    User............................................. admin
    Computer Name.................................... ADNIPHYPUAT01
    App Name......................................... FDMHFM
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... HYPUAT
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... HFMGLLOAD
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... WLCAT
    Category ID...................................... 12
    Period........................................... May - 2011
    Period ID........................................ 5/31/2011
    POV Local........................................ False
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    Thanks.
    Srini

    Hi, please try the mapping script again having the "Result=" statement on a separate line, like:
    If varValues(14)="113401" Then
    Result="21_ADNIP"
    Else
    Result="[ICP NONE]"
    End if
    Kind regards,
    Jeroen

  • Error in conditional map using User Defined Function

    All,
    In my mapping I basically have a user defined function that returns the filename of my inbound file from the adapter-specific message attributes (file adapter).  I know this is coded properly because if I simply assign this function to my destination field I can see the filename in the payload XML.
    However if I conditionally check that returned value using if,then,else I get an error message stating:
    "During the application mapping com/sap/xi/tf/_MaterialData2ZcustProdMastMulti_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformation"
    Essentially in my if I'm checking if the value returned by my user defined function is equal to the constant "SOMECONSTANT" then I'm setting my destination field to some other constant value.  Otherwise it's equal to a different constant value.
    Any thoughts?

    Claus,
    Thanks for the help.  I actually had figured the problem out on my own.  Sorry for not updating the thread sooner.  What happened was this (as I suspected it wasn't related to my user defined function).  For the newbies out there (of which I'm one) the problem was I was comparing strings in the graphical mapping tool using the Boolean "EQUALS" rather than the Text "EQUALSS".
    Can you give yourself points for solving

  • Help required on XSLT Conditional Mapping

    Hi,
    We need help on XSLT mapping in BPEL based on a condition. We are transforming from OAG format to a client specific format. We need to map a single tag (but repetitive) on the left hand side (OAG) to different tags on the right hand side. The same tag on the left hand side repeats with different values. Depending on the value the mapping to the right hand side varies. The left hand side (OAG) looks something like this.
    <PARTNER>
    <PARTNRID>2002</PARTNRID>
    <PARTNRTYPE>Supplier</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">2000 Century Way</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    <PARTNER>
    <PARTNRID>204</PARTNRID>
    <PARTNRTYPE>BillTo</PARTNRTYPE>
    <ADDRESS>
    <ADDRLINE index="1">90 Fifth Avenue</ADDRLINE>
    </ADDRESS>
    </PARTNER>
    Please note that the tag PARTNER and it's underlying tags appear twice in the XML file.
    Based on the value in the tag PARTNRTYPE, the mapping to the right hand side differs. If the value is 2002, PARTNRID should map to Supplier ID on the right hand side and if the value is 24, PARTNRID should map to BillTo ID on the right hand side. The right hand side should look something like
    <Supplier>
    <SupplierID>2002</SupplierID>
    <Address>2000 Century Way</Address>
    </Supplier>
    <BillTo>
    <BillToID>204</BillToID>
    <Address>90 Fifth Avenue</Address>
    </BillTo>
    Please let us know how to achieve this. Your help is much appreciated. Thanks in advance.
    Thanks,
    Prasanna

    Hi Prasanna ,
    I am not an expert but what about this:
    <SUPPLIERID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '2002']"/>
    </SUPPLIERID>
    <BILLTOID>
      <xsl:value-of select="/PARTNER/PARTNRID[../PARTNRTYPE = '24']"/>
    </BILLTOID>or
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '2002'">
        <SUPPLIERID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </SUPPLIERID>
      </xsl:when>
    </xsl:choose>
    <xsl:choose>
      <xsl:when test="/PARTNER/PARTNRTYPE = '24'">
        <BILLTOID>
          <xsl:value-of select="/PARTNER/PARTNRID"/>
        </BILLTOID>
      </xsl:when>
    </xsl:choose>Regards Pete

  • SRM 7.0 pricing conditions mapping to the backend system

    Experts,
      I am new to SRM & working in SRM 7.0.  I have a serious problem in distributing the pricing conditions.
      I need to distribute/map the pricing conditions in SRM 7.0 to the backend ECC system.  I need step by step procedure for the same.  Plz help me.

    Hi,
      with the help of SDN, i have done the mapping part of pricing conditions as below.
      field-symbols:
        <ls_be_item>      type BBPS_CTR_ITEM,
        <ls_be_cond>      type BBPBAPICONDCT,
        <ls_be_cond_bapi> type BBPBAPICONDIT.
      loop at ct_be_items assigning <ls_be_item>.
        if <ls_be_cond>-COND_TYPE = '0100'.
          <ls_be_cond>-COND_TYPE = 'PB00'.
        elseif <ls_be_cond>-COND_TYPE = '01CT'.
          <ls_be_cond>-COND_TYPE = 'PBXX'.
        elseif <ls_be_cond>-COND_TYPE = '01RA'.
          <ls_be_cond>-COND_TYPE = 'RB00'.
        elseif <ls_be_cond>-COND_TYPE = '01RP'.
          <ls_be_cond>-COND_TYPE = '01RP'.
        ENDIF.
        if <ls_be_cond_bapi>-COND_TYPE = '0100'.
          <ls_be_cond_bapi>-COND_TYPE = 'PB00'.
        elseif <ls_be_cond_bapi>-COND_TYPE = '01CT'.
          <ls_be_cond_bapi>-COND_TYPE = 'PBXX'.
        elseif <ls_be_cond_bapi>-COND_TYPE = '01RA'.
          <ls_be_cond_bapi>-COND_TYPE = 'RB00'.
        elseif <ls_be_cond_bapi>-COND_TYPE = '01RP'.
          <ls_be_cond_bapi>-COND_TYPE = '01RP'.
        ENDIF.
      endloop.
    But the problem is, when i put the external break point in the above code, its not getting triggered.  Can any plz tell me how to debug the code.

  • FDM Conditional mapping not working

    I currently have the following #script as my map in FDM. The first part of the map is not working as all the 9* source accounts are mapping to "70111". The rule should be; with any source account of "9*", with a source profit center where the 3rd digit is "??1???", then account is "43905", else "70111".
    If Left(varValues(23),3) = "1" Then
    Result = "43905"
    Else
    Result = "70111"
    End if
    Not sure why the first result is not working...anyone have any suggestions?

    Hi
    I think I may have seen this question answered previously but in case....
    Your IF statement is comparing the first 3 characters to "1" so it will never match.
    Assuming that you want to compare the 3rd character then you want If Mid(varValues(23),3,1) = "1" Then
    Hope this helps
    Stuart

  • Conditional Mapping to 835 schema

    I am interrogating a value in the incoming flat file schema and if the value is greater than '0' I am supposed to set some values in the CLP segment. However, if the value in the incoming schema is '0', I should not create the CLP segment. I'm not quite
    sure how to accomplish this. I am using inline c# in the scripting functoid to evaluate the incoming value and then set the value for the CLP01, CLP02, etc. The best I know how to do is....if the incoming value is '0', just return an empty string, but that
    creates a CLP segment with blank values in the CLP segment fields which is not allowed. How do I tell the map to not create the segment at all if the incoming value is '0'?
    Thanks.

    Prabhdeep,
    Your suggestion worked well. I actually mis-spoke as it is the AMT segment I'm working with. Anyway, your suggestion helped eliminate empty sub-elements in the AMT segment. However, since I am looping through three different fields in the incoming schema,
    I am still getting one empty top level AMT node, like this:
    <ns0:AMT_ClaimSupplementalInformation/>
    Whereas before your help I was getting this:
    <ns0:AMT_ClaimSupplementalInformation>
    <AMT01_AmountQualifierCode/>
    <AMT02_ClaimSupplementalInformationAmount>
    </ns0:AMT_ClaimSupplementalInformation>
    The other two fields I'm looping through have good data and the AMT segments for them get created correctly.
    Is there any way to tell the looping functoid NOT to loop for the field if the field contains certain data?
    Below is my map. You can see where I fixed the input for the CINELIGIBLE field based on your input. I still have to fix the CALLOWED and CBALANCE fields. You can see where I have to use a looping functoid because I have multiple fields to check on the left
     which are mapped to a single node tree(the AMT) on the right, that can repeat per the schema rules for the 835 schema.
    Thanks for your help!

  • FDM between conditional mapping across dimensions

    Okay, I have searched long and hard, and did not find an answer on this one. Conceptually, my problem is simple.
    What I want to do, is set the value in the ICP dimension to '[ICP None'] based on the value in the account dimension. Simple enough. Problem being that I only want this to happen in certain ranges of accounts so for example:
    Accounts B100-B200 should map to ICP None
    Accounts B500-B600 should map to ICP None
    Accounts B600-B700 should map to ICP None
    All others, should use the explicit mapping I already have for the ICP dimension members.
    I know I can write 10 nested 'if' statements to make it work in a script in a like or between mapping, but that is very ugly. I was hoping there was a way in the ICP Between mapping, to stick in the Rule definition the value of the account dimension.
    Hoping someone can help....

    I'm making the assumption that you do not currently use the account as the source value for your ICP mappings. What you could do is put an import script on the ICP dimension, if the account is in the ranges you specify it will pass the account as the source value or else it passes whatever you currently use as the ICP source value. You can then keep all your churrent mappings and just add a couple more to process the account ranges.

  • Error on conditional mapping script after upgrading from 9.3.1 to 11.1.2.1

    We have the following error while importing the data file on one location. The script is sitting on the Account Like mapping. It was working fine on 9.3.1 but not working on 11.1.2.1.
    Even after I removed the Case statement (so just leave the Ifxxxxx,Thenxxxx,Elsexxx,End If), it still doesn't work.
    Can anyone help please? Thank you !
    Error: An error occurred running the script:
    13 - Type mismatch: 'VarValues'
    At Line: 12
    Select Case VarValues(13) ‘Special Accounts
    Case "46221000","40974000","46713300","46747000","47111900","47414010","46871200"
    If VarValues(9)>0 Then
    RESULT="12009000"
    Else
    RESULT="20023490"
    End If
    Case "41110120","40119160","47311200"
    If VarValues(9)>0 Then
    RESULT="12009000"
    Else
    RESULT="20023490"
    End If
    End Select

    Have you tried converting the value of the amount to a double? I just went up to 11.1.2.2 and had a similar problem when referencing the amount and using a number.
    Select Case VarValues(13) ‘Special Accounts
    Case "46221000","40974000","46713300","46747000","47111900","47414010","46871200"
    If CDBL(VarValues(9))>0 Then
    RESULT="12009000"
    Else
    RESULT="20023490"
    End If
    Case "41110120","40119160","47311200"
    If CDBL(VarValues(9))>0 Then
    RESULT="12009000"
    Else
    RESULT="20023490"
    End If
    End Select
    Regards
    JTF

  • Conditional mapping in the transformation file

    Hi
    Can anyone tell me if it is possible to perform more complex mapping when loading transactional data? I have 2 requirements:
    1. When the Profit Centre is invalid, set it to a default value of "9999".  Where an invalid Profit Centre is a Profit Centre that does not exist as a valid dimension member.
    2. When the Profit Centre is null, then set it to a default value based on the Entity value.
        For example:
        When the Profit Centre is null and the Entity = 100, set the profit centre to 1000.
        When the Profit Centre is null and the Entity = 200, set the profit centre to 2038. etc
    Ideally I would like to define the mapping rules in either transformation or conversion files.
    Regards, Sharon

    What I can think right now is
    Case 1:
    If you're with BPC 7.0 NW, there is no option to accept not existing member and store it with a default value(Correct me if I'm wrong).
    But you can enable VALIDATERECORDS=YES in the transformation file to output the rejected records with wrong dimension member into a file. Since we need all the rejected records and keep processing the current import, set MAXREJECTCOUNT=-1.
    Next do additional task in your import package to rename all the rejected Profit Center with the default value (9999) and do re-import again.
    Limitation: this will work only if you want to do fix on 1 dimension  in this case the Profit Center. If you need to do fix on multiple dimension, this would not work because the rejected records could be caused by any dimension. So you're lucky in your case.
    If you're with BPC 7.5 NW, use DM BADI to do what you want.
    Case 2:
    You can use IF in your mapping section, for example:
    ProfitCenter=*IF(ProfitCenter = *str(),*IF(Entity=100,*str(1000),...),ProfitCenter)
    Halomoan

  • Shipping condition mapping during Order load

    Hi Experts,
                      I have two SAP systems A and B.
    1. PO is created in A and sends over that to B.
    2. It is required to pass shipping condition(VBAK-VSBED) from A to B. But shipping conditions used in System A are diff than B. so system B has to interpret A's shipping conditions.
    3. Currently A is not passing shipping condition.
    4. It is a ALE interface.
    Here is my questions.
    1.  Which program/FM is required to be modified in System A?
    2. Which program is required to modified in System B?
    I have got confused with programs/FM's used to create IDOC's and Orders in the system, Can you throw some light on that as well?
    Thank you
    Kris
    Edited by: Kris on Feb 9, 2010 11:16 PM
    Edited by: Kris on Feb 10, 2010 4:59 AM

    Hi Anu,
    I don't know what you support package level is but in the past the problem has happened due to the
    errors described  in the notes 1080181 and 1041284. If these notes were not applied in your
    system please apply them and check if the problem still exists with a new data load
    afterwards.
    Regards,
    Des Gallagher.

Maybe you are looking for

  • ASA and Cisco VPN question

    I am having an issue on a new ASA. I am able to connect to the customer?s network using the Cisco VPN client, but I am not able to PING or access anything on the customers network. What needs to be done to fix this??? There is a route on the customer

  • Sound goes off while playing games.

    Nokia, Some time I face a problem that when i play game like prince of persia, bounce and others, the game sound become turn off after some time playing though the apps tone is on. Any games sound does not on untill the phone get restart. But is does

  • When in the camera app my screen flashes purple and my front camera doesnt work

    my front camera doesnt work, my back camera flashes purple when i use it. - what should i do, where should i go to get it looked at and is it a technical default on my phone or has it happened to anybody else?

  • I - Views & Infosets

    Hi Experts, Could you please help me on how to create I view in Content Adminstration for Employee Personal Information and how do we configure Infosets, and do we make the Infotype fields available in ESS and hide. Thanks in Advance Priya

  • Acquiring data in LabVIEW FPGA

    Hello, I am working on LabVIEW FPGA where I have to acquire data from a source and take its average. One way to do that is to keep adding every new signal to the sum f the older ones and then average. However, I wish to store all the incoming values