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

Expression help

Hi all,

I am looking for some help with an expression please.

I have a week fiels (Cal_Week) and a sales field (SalesValue)

I am trying to do a straight table showing sales this week then going back 10 weeks.

so i have :

Sales This       Sales -1      Sales - 2    Sales  -  3    etc

Weeks

1000                   954             985            1200          etc

i have the following expression which gives me the previous weeks sales

=sum({$<Cal_Week={$(#=Only(Cal_Week)-1)}>}SalesValue)

=sum({$<Cal_Week={$(#=Only(Cal_Week)-2)}>}SalesValue) etc

this all works great, but what i also want to add into the above expressions is to always show data even if no weeks are selected.

So when the app is opened by the user, i want them to see the most up to date week in the Sales This Week column.

Example.

if we are currently reporting on week 40, then i would want week 40 to be in the Sales This Week column, then going 10 weeks back from that.

then if the user was to select week 35 instead, then the Sales This week would reflect the week selected and go 10 weeks back from that.

Does that make sense?

1 Solution

Accepted Solutions
MayilVahanan

hi

use max() function,instead of only() function..

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

1 Reply
MayilVahanan

hi

use max() function,instead of only() function..

hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.