# App Development

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for
Did you mean:
Specialist

## Current Month Previous year

Hi,

I wonder why using the current month doesn't work for previous year:

sum({<Month={'\$(vMaxMonth)'}, Year={'\$(vPreviosYear)'}>} LineTotal)

Only a date range:

sum({<Date= {">=\$(vMonthStartPrevYear) <=\$(vMonthEndPrevYear)"}, Year=,Month=, Date=>} LineTotal)

Thanks!

1 Solution

Accepted Solutions
MVP

Huh!! even the hard coding gives the incorrect result? That is very strange.... also, I made a mistake in my previous expression... Year and Month should not repeat... can you try this and see if this works

Sum({<Month={'10'}, Year={'2017'}, Date>} LineTotal)

4 Replies
MVP

May be you have to ignore selection in Year, Month and Date just like your other expression

Sum({<Month={'\$(vMaxMonth)'}, Year={'\$(vPreviosYear)'}, Year, Month, Date>} LineTotal)

Specialist
Author

Hi Sunny,

It doesn't help..

even writing the expression as follows gives a wrong result:

sum({<Month={'10'}, Year={'2017'},Year=,Month=,Date=>} LineTotal)

I'm getting a much larger sum then expected, but can't figure what it is..:-(

Thanks!

MVP

Huh!! even the hard coding gives the incorrect result? That is very strange.... also, I made a mistake in my previous expression... Year and Month should not repeat... can you try this and see if this works

Sum({<Month={'10'}, Year={'2017'}, Date>} LineTotal)

Specialist
Author

Great, Sonny!

"Year and Month should not repeat" - made my day!

Thank you!

Tags
Community Browser