Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hi set analysis?

Hi

my req is

i have a listboxs   year and sales

now i am seeing chart   sum(sales) based on year

year:

1999

2000

2001

2002

2003

2004

2005

2006

2007

2008

my req is if i click on any year then i want see sales from that year to next 3 years

for ex

if i click on  2002  then i want see for 2002,2003,2004,2005

how to write set analysis for this ?

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

SUM({$<year = {">=$(=Max(year)-3)<=$(=Max(year))"}>}sales)

View solution in original post

8 Replies
Anonymous
Not applicable
Author

This will work:

sum({<Year={">=min(Year)<= $(=min(Year)+3)"}>} Sales)

(If you don't select anything, it will show from 1999)

MK_QSL
MVP
MVP

SUM({$<year = {">=$(=Min(year))<=$(=Min(year)+3)"}>}sales)

Anonymous
Not applicable
Author

no it is not working

its giving all years data if i selected any year also

Anonymous
Not applicable
Author

It works, I tested.  Upload your app to see what's wrong.

Edit: My bad, mistyped, missed $( =min(Year) ) for the min(Year)

Anonymous
Not applicable
Author

hi its working manish  great you are always.

in the same way i want in reverse order like

selection to efore 3 months

MK_QSL
MVP
MVP

SUM({$<year = {">=$(=Max(year)-3)<=$(=Max(year))"}>}sales)

NickHoff
Specialist
Specialist

Michael's solution should work for you, but if not then it's a data model issue.  Try to associate the date in your fact table to your master date table by creating an allias of same name.

Not applicable
Author

hii

try this expression

sum({$<year = {">=$(=Min(year))<=$(=Min(year)+3)"}>}sales)