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

Showing previous month

All,

I have a very simple question but can't seem to figure it out.

I am trying to create a table with the first colum the month selected and the next colum should show the previous month (so if i selected march I want to see february in the next colum)

And for some reason I can't get it to work, I tried everything from month-1 to all kinds of date fields.

Hope someone can help me.

Regards, Paul

1 Solution

Accepted Solutions
Not applicable

Hi Paul,

Now you see the no. in table also. Please find the Attachment.

Regards,

Nirmal.

View solution in original post

14 Replies
Not applicable

Can you post sample data ?

sushil353
Master II
Master II

try this:

present month;

sum({<date={'$(max(date))'}>}value)

previous month:

sum({<date={'$(=addmonths(date,-1))'}>}value)

HTH

Sushil

pauldamen
Partner - Creator II
Partner - Creator II
Author

Hi Sushil,

I tried your option but still only showing 0.

I attached the file, it is the second tab, I am using the textboxes to test.

Regards,

Paul

Not applicable

Dear Member,

Create Two Variables

Var1:----------max(month(date))   --------------------- currmonth

var2 '''''''''''''''''''''''addmonths(max(month(date,-1)) -------------- prev month

nirav_bhimani
Partner - Specialist
Partner - Specialist

HI,

Previous Month:

=sum({<CalYear={$(=max(CalYear))},CalMonth={$(=month(addmonths((max(Date)),-1)))}>}Sales)

Current Month:

=sum({<CalYear={$(=max(CalYear))},CalMonth={$(=Month(Max(Date)))}>} Sales)

Regards,

Nirav Bhimani

manideep78
Partner - Specialist
Partner - Specialist

Try this expression in your test box where you are testing your previous one

=Date(Date#(AddMonths(Month,-1),'MM-DD-YYYY'),'MMM')

Hope this helps

pauldamen
Partner - Creator II
Partner - Creator II
Author

Whatever I try I converts the previous month into a number and then I doesn't work I the table.

Whatever I try the table stays empty for the previous month, see the file I attached for the details

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

I guess the problem with your month field only, Because of that only it doent give any output otherwise expression is OK.

Regards,

Nirav Bhimani

Not applicable

Hi,

Please Find the Attachment.

Regards,

K.J.Nirmal Raj.