Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to write expression

Hello All,

             For 201706 i need to show sum of volume from 201704 to 201705 only which is -700-200+700+1700-1700+2200==2000 so i need to 2000

Capture.PNG

Capture1.PNG

please suggest how to write a expression to achieve above requirement

thanks

11 Replies
Anil_Babu_Samineni

May be this?

Sum({<CALMONTH = {'201704','201705'}>} VOLUME)

Or

Sum({<CALMONTH = {">=$(=Max(CALMONTH)-2) <$(=Max(CALMONTH))"}>} VOLUME)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Only for 201706? What about other CALMONTH?

its_anandrjs

It is dynamic or hardcoded value let me know.

kunkumnaveen
Specialist
Specialist
Author

thanks for ur quick reply,s

Sorry i think, i haven't  clearly explain this requirement

what if  201710 is selected

then i need to show volume from   201704 to 201709

kunkumnaveen
Specialist
Specialist
Author

currently i need to show only 201706 but it has to be dynamic what i mean what i mean is

for 201710 i need to show sum of volume from 201704 to 201709

Anil_Babu_Samineni

That mean you only need current month of data? May be this?

Sum({<CALMONTH = {">=$(=YearStart(Max(CALMONTH))) <$(=Max(CALMONTH))"}>} VOLUME)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kunkumnaveen
Specialist
Specialist
Author

currently i need to show only 201706 but it has to be dynamic what i mean what i mean is

for 201710 i need to show sum of volume from 201704 to 201709

its_anandrjs

For 201710 May Be it is 201708 to 201709

Try this it is dynamic and based on selection as well

Sum({<CALMONTH = {">=$(=Date( Addmonths(Max(CALMONTH),-2 ),'YYYYMM' ) <$(=(Max(CALMONTH))"}>} VOLUME)

its_anandrjs

And may be this

Sum({<CALMONTH = {">=$(=Date( Addmonths(Max(CALMONTH),-2 ),'YYYYMM' )

                                       <$(=(Date(Max(CALMONTH),'YYYYMM')"}>} VOLUME)