
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Previous Month
Hello ppl!
I have a question!
Ived created a variable called vPreviousMonth =month(addmonths(max(Date_Clean),-1))
I want a straight table which shows current month i have selected (ive made that) and then i want the previous table to show previous month
e.g. If i am in November i also want to see October - If i am in July, i also want to see June..
How do i make that expression?
My expression for currentmonth looks like this:
=Sum({<Month=, Year=,2012={'>=$(=MonthStart(Max(2012)))<=$(=Max(2012))'}>}BuyPriceRealized)
I dont know if that expression is correct if not i would also like to know how the "right" way is to do it...
Thanks ALOT!!
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
no change required in expression
see below code
first expression
Sum({$<Month={"$(vCurrMonth)"}>}Volume)
second expression
Sum({$<Month={"$(vLastMonth)"}>}Volume)
third expression
=Column(1)-Column(2)
hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have only founded soulution where they use TODAY, -1 or -2 etc etc.. But i dont want it to be hardcoded As you can see my currentmonth is not hardcoded and changes every time i select a new month

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The only thing to note with the attached example is that the year may be confusing... For example, if you select Jan, the past month will be Dec, but it would be for the same year unless you specify otherwise.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
let us take example u have month field name( jan, feb, mar.......dec for year 2012
so u can create a variabe vmonth = Month
and in the expression
=Sum({<Month={ '$(vmonth)'}, Year=2012)'}>}BuyPriceRealized) this will show the month u have selected for year 2012
for previous year calculation i would suggest take the month number and convert into previous month number and then convert into month name in the expression..

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thats okay cause i only have one year.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But i already have current month i am in. I only need previous month

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anybody else who have an suggestion?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your expression does not work e:/ But anyhow ived already made currentmonth Can u explain what u mean by converting? or give me an example - It should be previousmonth not previousyearmonth
Thanks in advanced!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
why Not Use MonthYear
vCurrMonth== Max(MonthYear)
vPrevMonth==Date(addmonths(Max(MonthYear),-1),'MMM-YYYY')
and In Label Left(vCurrMonth,3) and Left(vPrevMonth,3)
hope this helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So i create a variable called vCurrMonth and a variable called vPrevMonth
What do i write in my expressions then for my straight table? Just the Variable???

- « Previous Replies
-
- 1
- 2
- Next Replies »