Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
limingthefirst
Contributor III
Contributor III

Daily Year over Year in text object

Hi Everybody,

I am trying to get a year over year analysis to work both by year/quarter/month/week selections.

And also working in selected StartDate/EndDate calendar object.

So I can select any time interval by StartDate/EndDate calendar.

The variables for year over year I used below:

vLastYear=addmonths(MaxString(Delivery_Date),-12)

vCurrentYear=if(GetSelectedCount(Year)=0,max(Year),Year)


The value of Delivery_Date column is started from 1/1/2016.

Now I need to get a year over year value into text object:

Current Year Sales:

=sum({<Year={$(vCurrentYear)}>} Delivery_Amount)

Last Year Sales:

=sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}>} Delivery_Amount)

The issue is when I don't select Year, the Last Year Sales is correct, but if I select 2017 in Year selections,

the Last Year Sales is 0.

If the time interval of Last Year Sales is out of Year selection or not?


Can anybody help me to correct the variables or extensions?


Many thanks

Ming

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}, Year>} Delivery_Amount)

View solution in original post

2 Replies
sunny_talwar

Try this

=Sum({<Delivery_Date={">=$(=yearstart(vLastYear))<=$(=(vLastYear))"}, Year>} Delivery_Amount)

limingthefirst
Contributor III
Contributor III
Author

It's you! thank Sunny!