Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
arulsettu
Master III
Master III

how to get last 6 months value

hi

     i need to find last six month value but i have only year and month field alone.

i used this  sum({$<ACNT_FLEX_02={'Balance Sheet'},datefield={">=$(vPrior6)"}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

vPrior6= AddMonths(max(datefield),-6)


datefield is MakeDate(TBAL_CAL_YEAR,TBAL_CAL_MONTH) as datefield


but i am not getting last six month values


please help


thanks

17 Replies
arulsettu
Master III
Master III
Author

suggest some ideas please

maxgro
MVP
MVP

tried this and it seems correct

sum(

     {

          <ACNT_FLEX_02={'Balance Sheet'},

          datefield={">=$(=addmonths(makedate(TBAL_CAL_YEAR, TBAL_CAL_MONTH),-6))"}>

     } somefield)

to debug remove the label of the expression in a chart and check the date you get inside {}; it should be the same format as your datefield

1.png

arulsettu
Master III
Master III
Author

Hi

    thanks for reply but i am getting zero only can u check this app and guide me what i am doing wrong please...

arulsettu
Master III
Master III
Author

hi maxgro

                                      i used this one also to get last six month values

sum({$<ACNT_FLEX_02={'Balance Sheet'},TBAL_CAL_MONTH={$(=max(TBAL_CAL_MONTH)-6)},TBAL_CAL_YEAR={$(=max(TBAL_CAL_YEAR))}>}TBAL_MTD_DR_LC_1-TBAL_MTD_CR_LC_1)

i am getting value for 112 to 6 months if i select 5 th month getting blank values only

can you suggest me why

thank you

maxgro
MVP
MVP

if I understand

select a month and you get the values

or, maybe, use max(month) max(year) to always have a date

1.png

arulsettu
Master III
Master III
Author

but i am getting zero. can you please send the result in same app. and i noticed one thing the value we are getting and current value are same

current is 78333122 and six month previous also 78333122

please check it

thanks

arulsettu
Master III
Master III
Author

Hi maxgro,

                               using max(month) max(year) gives only value up to 6 to 12 months  if i select 6 month max(month) showing zero for 5th its -1. but i need if i select 6th it should show previous year 12th month value

can you please give me some idea why happening

thank you

arulsettu
Master III
Master III
Author

any ideas guys please help

arulsettu
Master III
Master III
Author

any one got solution for this its emergency please suggest something