Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to compare year to date,
Now I do
for 2017 = Sum({$<Year = {$(#=(Year-1), Month=, Date=,)}, } Sales) >>> 1-15 Sep 2017
for 2016 = Sum({$<Year = {$(#=(Year-1), Month=, Date=,)}, } Sales) >>> 1-30 Sep 2016
but I need
for 2017 = Sum({$<Year = {$(#=(Year-1), Month=, Date=,)}, } Sales) >>> 1-15 Sep 2017
for 2016 = Sum({$<Year = {$(#=(Year-1), Month=, Date=,)}, } Sales) >>> 1-15 Sep 2016
Hi,
If you have date field
then try like
sum({<date={"=date(addYears(max(date),-1)))"}>}Sales)
Regards,
Consider you have Date field in your Data Model &
Assume 2 Variable for From Date & To Date as vFromDate & vToDate respectively.
Then Try CY YTD
sum( {<Date = {">=$(=vFromDate) <= $(=vToDate)"}>}Sales)
For LY YTD
sum( {<Date = {">=$(=date(addyears($(vFromDate),-1))) <=$(=date(addyears($(vToDate),-1)))"}>}Sales)
Thank you for you help. Your answer is correct, but I have a problem if I choose year and date as attach file,
It's not work. How should I do?
stalwar1 Help me pleaseeeeee
Try this for last year
Sum({<Date = {">=$(=Date(AddYears($(vFromDate),-1)))<=$(=Date(AddYears($(vToDate),-1)))"}, Year, Month>}Sales)
Can not . stalwar1
Can you explain in words as to what is the issue?
If I select
1. Month = September & Year = 2017 > Result will show summary all month (1-30 Sep 2016)
2. Period 1-15 September 2017 > Result will show summary 1-15 Sep 2016
But this expression it's work only 2. (Select Period), I need both condition.
Sum({<Year, Month, date_key = {">=$(=Date(AddYears($(vDateFrom),-1)))<=$(=Date(AddYears($(vDateTo),-1)))"}>}Fact_Tran.Qty)
can you provide sample app???
Regards,