Hi, I've a graffic where I show the Amount of the last 6 month. I've got 6 variables, like this:
LastMonth = Date(monthstart(Today()), 'MMM-YYYY')
LastMonth1 = Date(monthstart(Today()-1), 'MMM-YYYY')
LastMonth2= Date(monthstart(Today()-2), 'MMM-YYYY')
LastMonth3 = Date(monthstart(Today()-3), 'MMM-YYYY')
LastMonth4 = Date(monthstart(Today()-4), 'MMM-YYYY')
LastMonth5 = Date(monthstart(Today()-5), 'MMM-YYYY')
And my Graffic is like this:
Product | =lastMonth5 | =lastMonth4 | =LastMonth3 | =LastMonth2 | =LastMonth1 | =LastMonth |
---|
Product1 | sum({$<Month={'$(LastMonth5)'}>}Amount) | sum({$<Month={'$(LastMonth4)'}>}Amount) | sum({$<Month={'$(LastMonth3)'}>}Amount) | sum({$<Month={'$(LastMonth2)'}>}Amount) | sum({$<Month={'$(LastMonth1)'}>}Amount) | sum({$<Month={'$(LastMonth)'}>}Amount) |
I've got 6 expressions for this graffic:
sum({$<Month={'$(LastMonth)'}>}Amount)
sum({$<Month={'$(LastMonth1)'}>}Amount)
sum({$<Month={'$(LastMonth2)'}>}Amount)
sum({$<Month={'$(LastMonth3)'}>}Amount)
sum({$<Month={'$(LastMonth4)'}>}Amount)
sum({$<Month={'$(LastMonth5)'}>}Amount)
The actually Graffic it would be that:
Product | may-12 | Jun-12 | Jul-12 | Ago-12 | Sep-12 | Oct-12 |
---|
Product1 | 100 | 500 | 600 | 485 | 458 | 711 |
I want to use, in the variable, the max date that I've got in my filters, not Today(). If now I filter for the Date 20111230, my graffic should be this:
Product | Jul-11 | Ago-11 | Sep-11 | Oct-11 | Nov-11 | Dic-11 |
---|
Prodcut 1 | 45 | 89 | 0 | 54 | 66 | 12 |
Then, I need to use in my variable LastMonth the Max. Date that I have in my filters:
LastMonth = Date(monthstart(Today()), 'MMM-YYYY')
LastMonth = Date(monthstart(MaxDateInMyFilter()), 'MMM-YYYY')
How Can I do that?
Thank you very much