Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

6 months

I need an expression to just display the last 6 months data only on my staright table..I have a Month and year column

13 Replies
Anonymous
Not applicable

try this

Month Need to be your monthfield

Monthnum contains month number, if not available use other date functions

sum({<Month=,Monthnum={'>=$(max(Monthnum)-1)'}>}

alternate:

sum({<Month=,Datefield={'>=$(monthstart(addmonths(max(Datefield)-6)))'}>}

vinieme12
Champion III
Champion III

SUM(  {< Year = {$(=Max(Year))}

               , Month = {">$(=Max(Month)-6)<=$(=Max(Month))"}

                  >}  YOURFIELD )

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable

Hi try this

*Provided : Your Month is in 'MMM' format (JAN,FEB,...etc.,) and aggregating on sales ...

Sum({$<[Month]={">=$(=Date(AddMonths(Max(Month), -6), 'MMM'))<=$(=Date(Max(Month),'MMM'))"}>}[Sales])

maxgro
MVP
MVP

look at the attachment

1.png

jmvilaplanap
Specialist
Specialist

It depends if you want to show the last six months since today or the last six months since the last date selected.

(Updating the previous response)

SUM(  {< Year = {$(=Year(Today()))}

               , Month = {">$(=Month(Today())-6)<=$(=Month(Today())"}

                  >}  YOURFIELD )

raadwiptec
Creator II
Creator II
Author

hi jose

i need

last six months since today


for ex: August ---> back to Feb


Jan  should not be displayed.







jmvilaplanap
Specialist
Specialist

Then you can use my proposal:

SUM(  {< Year = {$(=Year(Today()))}

               , Month = {">$(=Month(Today())-6)<=$(=Month(Today())"}

                  >}  YOURFIELD )

But be careful with other date fields when you filter in the dashboard, you must put it in the set analisys with blank filter, for example {< Year = {$(=Year(Today()))}, Date=>}.

raadwiptec
Creator II
Creator II
Author

hi jose this is not working ... i need generic calculation condition in the general tab of the chart saying

year is max of year and month is 6 months data only

jmvilaplanap
Specialist
Specialist

6 months data only means for example if today is 08/25/2016, you must show data from 02/25/2016 or from 02/01/2016?

In the fisrt case you mus use date instead year and month.