If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Previous value
Hi there,
In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#2
|
|||
|
|||
Previous value
I can't tell from your description how you (and therefore, how Access)
determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#3
|
|||
|
|||
Previous value
I can't tell from your description how you (and therefore, how Access)
determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#4
|
|||
|
|||
Previous value
I can't tell from your description how you (and therefore, how Access)
determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#6
|
|||
|
|||
Previous value
Hi Jeff,
Thank you for having tried to understand my question. and sorry for not making clear enough! What I'm trying to calculate is chained year to date performance that you calculate like: First month: JanuaryPerf = X/(Y+Z) Next month FebruaryPerf = (1 + JanuaryPerf) * (1 + (X/(Y+Z)))-1 Next month MarchPerf = (1 + FebruaryPerf) * (1 + (X/(Y+Z)))-1 It would have been easy to do it with a running sum if it was an addition, but my desperate case, it's a product. and I can't think of aggregate functions neither, because only the addition is used whether in the sum or the avg function.. So what I'm doing now, because I haven't find an easier solution to it in a query or a report is to calculate it in vba, store the result and display them with the rest of info. unless you have a better advice Thanks again "Jeff Boyce" a écrit dans le message de news: ... I can't tell from your description how you (and therefore, how Access) determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#7
|
|||
|
|||
Previous value
Hi Jeff,
Thank you for having tried to understand my question. and sorry for not making clear enough! What I'm trying to calculate is chained year to date performance that you calculate like: First month: JanuaryPerf = X/(Y+Z) Next month FebruaryPerf = (1 + JanuaryPerf) * (1 + (X/(Y+Z)))-1 Next month MarchPerf = (1 + FebruaryPerf) * (1 + (X/(Y+Z)))-1 It would have been easy to do it with a running sum if it was an addition, but my desperate case, it's a product. and I can't think of aggregate functions neither, because only the addition is used whether in the sum or the avg function.. So what I'm doing now, because I haven't find an easier solution to it in a query or a report is to calculate it in vba, store the result and display them with the rest of info. unless you have a better advice Thanks again "Jeff Boyce" a écrit dans le message de news: ... I can't tell from your description how you (and therefore, how Access) determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#8
|
|||
|
|||
Previous value
I see nothing in your formula or description about "year". Are you
attempting to apply this across multiple years, or only for one year's data? Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi Jeff, Thank you for having tried to understand my question. and sorry for not making clear enough! What I'm trying to calculate is chained year to date performance that you calculate like: First month: JanuaryPerf = X/(Y+Z) Next month FebruaryPerf = (1 + JanuaryPerf) * (1 + (X/(Y+Z)))-1 Next month MarchPerf = (1 + FebruaryPerf) * (1 + (X/(Y+Z)))-1 It would have been easy to do it with a running sum if it was an addition, but my desperate case, it's a product. and I can't think of aggregate functions neither, because only the addition is used whether in the sum or the avg function.. So what I'm doing now, because I haven't find an easier solution to it in a query or a report is to calculate it in vba, store the result and display them with the rest of info. unless you have a better advice Thanks again "Jeff Boyce" a écrit dans le message de news: ... I can't tell from your description how you (and therefore, how Access) determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#9
|
|||
|
|||
Previous value
What I mean by a year to day performance is a performance calculated since
the beginning of the year until today Generally from January to the current date (12 months maximum). But I customize the formula by letting the user choose his own interval of time. it can go from Date1 to Date2 Best regards "Jeff Boyce" a écrit dans le message de news: ... I see nothing in your formula or description about "year". Are you attempting to apply this across multiple years, or only for one year's data? Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi Jeff, Thank you for having tried to understand my question. and sorry for not making clear enough! What I'm trying to calculate is chained year to date performance that you calculate like: First month: JanuaryPerf = X/(Y+Z) Next month FebruaryPerf = (1 + JanuaryPerf) * (1 + (X/(Y+Z)))-1 Next month MarchPerf = (1 + FebruaryPerf) * (1 + (X/(Y+Z)))-1 It would have been easy to do it with a running sum if it was an addition, but my desperate case, it's a product. and I can't think of aggregate functions neither, because only the addition is used whether in the sum or the avg function.. So what I'm doing now, because I haven't find an easier solution to it in a query or a report is to calculate it in vba, store the result and display them with the rest of info. unless you have a better advice Thanks again "Jeff Boyce" a écrit dans le message de news: ... I can't tell from your description how you (and therefore, how Access) determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
#10
|
|||
|
|||
Previous value
I still am not clear how you are limiting the records on which you are
trying to do this to the current year. What if someone entered the following two values for Dates: 1/1/2008 to 12/31/2009 That date range would have two Januaries, and two Februaries, ... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... What I mean by a year to day performance is a performance calculated since the beginning of the year until today Generally from January to the current date (12 months maximum). But I customize the formula by letting the user choose his own interval of time. it can go from Date1 to Date2 Best regards "Jeff Boyce" a écrit dans le message de news: ... I see nothing in your formula or description about "year". Are you attempting to apply this across multiple years, or only for one year's data? Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi Jeff, Thank you for having tried to understand my question. and sorry for not making clear enough! What I'm trying to calculate is chained year to date performance that you calculate like: First month: JanuaryPerf = X/(Y+Z) Next month FebruaryPerf = (1 + JanuaryPerf) * (1 + (X/(Y+Z)))-1 Next month MarchPerf = (1 + FebruaryPerf) * (1 + (X/(Y+Z)))-1 It would have been easy to do it with a running sum if it was an addition, but my desperate case, it's a product. and I can't think of aggregate functions neither, because only the addition is used whether in the sum or the avg function.. So what I'm doing now, because I haven't find an easier solution to it in a query or a report is to calculate it in vba, store the result and display them with the rest of info. unless you have a better advice Thanks again "Jeff Boyce" a écrit dans le message de news: ... I can't tell from your description how you (and therefore, how Access) determines "previous". You'll need to be able to define that in a way that you can explain to Access. If you are trying to build a "running sum" (again, not enough info in your description), Access offers a Running Sum property for a textbox control in a report definition. More info, please... Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "warrio" wrote in message ... Hi there, In a detail section, is there a way to get the previous field value in the previous record? I'm asking this because each current is calculated with the previous value. The first a simple calculation based on current values. looks like recursive code, but how to do without vba? Thanks in advance for any good suggestion |
|
Thread Tools | |
Display Modes | |
|
|