Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Period and Last year Same Period

Hi

I am preparing a dashboard for compare profit and loss for this year vs last year.Depend on the year selection I want to display current period and last year same period in the other column but it doesn't seems to work.

Can someone give me a hand on this?

Thank you

Harsh

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

See the attached file

View solution in original post

11 Replies
Not applicable
Author

sum({<Year={$(=Max(Year)-1)},Period=>}Amount)

Try that.

Not applicable
Author

I have tried that. it didn't work.

hic
Former Employee
Former Employee

Please check Year-Over-Year comparisons.

HIC

Anonymous
Not applicable
Author

There was extra "=" and you don't want to have that "Period=" there as it ignores all selections from Period dimension.

Not applicable
Author

it is working.

avinashelite

Hi Harsh,

Please find the attached QVW file for solution.

Regards,

@vi

aveeeeeee7en
Specialist III
Specialist III

Create 2 Expressions:

1)  For Current Year

num(Sum({<Year={$(=max(Year))},Month={"<=$(=max({<Year={$(=max(Year))}>} Month))"}>}Sales),'#,##0') 

2) For Previous Year Same Period

num(Sum({<Year={$(vLastYr)},Issue_Date={"<=$(=date(SetDateYear((today()-1),max(Year-1)), 'DD-MM-YYYY'))"}, Month >}Sales),'#,##0')

Where vLastYr=max(Year)-1  (Create a variable)

The Data will change as per the Selections done in the Year List Box.

Hope that fulfills your requirement.

Regards

Aviral Nag

SunilChauhan
Champion
Champion



Current period  : sum({<Period={$(=Max(Period))}>}Amount)


last year same period: sum({<Period={$(=Max({<Year={$(=Max(Year)-1)}>}Period))}>}Amount)


hope this helps

Sunil Chauhan
er_mohit
Master II
Master II

See the attached file