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: 
chriscools
Creator II
Creator II

graph showing last 60 days

Hello,

how should i adapt my formula if i only want to show sales during the last 60 days?

Sum ({<Shop= {'Pomax Store Wijnegem'}, Year= {"2012"}>}LineSalesAmount

i also want to include an extra line showing only the sales from today minus 1 year and then also 60 days back...

thanx!

grtz,

chris

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Your expression was missing a closing '}' . This will work to show the line in your chart:

Sum({<Shop= {'Pomax Store Wijnegem'}, Year = {$(= Max(Year))}, Date = {">=$(=Date(Max(Date)-90)<=(=Date(Max(Date))))"}  >} LineSalesAmount)


talk is cheap, supply exceeds demand

View solution in original post

10 Replies
Not applicable

what do u mean by extra line?

is there any date field in ur table from where u're taking Year?

chriscools
Creator II
Creator II
Author

i want to make a line graph, so 1 line would last 60 days of this year, and the 2nd line the 60 same days but 1 year earlier.

there i a calendar table with date and derived year, month, week.

chris

SunilChauhan
Champion II
Champion II

Current Year

sum({<Year={$(=Max(Year))},Month={">$(=admonths(max(Month),-2))<=$(=admonths(max(Month),0))"}>}Amount)

Last year Line

sum({<Year={$(=Max(Year))},Month={">$(=admonths(max(Month),-2))<=$(=admonths(max(Month),0))"}>}Amount)

Hope this helps

Sunil Chauhan
SunilChauhan
Champion II
Champion II

beter to use below code

Current Year

sum({<Year={$(=Max(Year))},date={">=$(=Date(Max(date)-60)<=$(=Date(Max(date))))"}>}Amount)

Last Year Line

sum({<Year={$(=Max(Year)-1)},date={">=$(=Date(Max(date)-60)<=$(=Date(Max(date))))"}>}Amount)

this will helps to acheve correct Result

hope this helps

Sunil Chauhan
chriscools
Creator II
Creator II
Author

Hello,

thanx for your answer, but isn't the expression for last year not the same as the current year?

should i do max(year) - 1 ?

grtz,

chris

SunilChauhan
Champion II
Champion II

yse you need to do that

see my second post its there

there are two formulas

for max year and second max year

Hope this helps

Sunil Chauhan
chriscools
Creator II
Creator II
Author

oh, sorry indeed! i missed the -1...

i still can not get even the first formula to work, to show me the last X days of this year...

could you have a peek at what i'm doing wrong?

thankx!

Gysbert_Wassenaar

Your expression was missing a closing '}' . This will work to show the line in your chart:

Sum({<Shop= {'Pomax Store Wijnegem'}, Year = {$(= Max(Year))}, Date = {">=$(=Date(Max(Date)-90)<=(=Date(Max(Date))))"}  >} LineSalesAmount)


talk is cheap, supply exceeds demand
chriscools
Creator II
Creator II
Author

thanx, indeed i missed one! 🙂

what should the formula if i want to make it independant of selections?

thanx!