Announcements
cancel
Showing results for
Did you mean:
Creator

Set analysis help

Hi,

I’m trying to show unique customers per quarter for the last 5 years. The expression works well when no year selection is made. But when year is selected, it hides few customers and the total count varies.

E.g.: Customer “AIEAJKI” is a unique customer in 2015 (Direct/Product) and 2017 (Direct/Services). The report displays it when no year selection is made. But when I select 2015, it disappears from the report. Also, I would like the chart to show data only for the last five years. When I select 2013 or prior years, it shouldn’t display any data. Why does that happen? Maybe, I’m missing something in my expression. Attached is my sample dataset. Any help is appreciated.

Here is my expression:

Sum(Aggr(If(Customer.Mth_Year = Min({1<Date={">=\$(=YearStart(Max(Date), -4))<=\$(=Date(Max(Date)))"},Customer.QTR=,Customer.Month=,Customer.Year>}TOTAL <[Direct/Indirect Customer],Segment,[Direct/Indirect Customer Name]> Customer.Mth_Year), 1, 0), Direct/Indirect Customer],Segment,[Direct/Indirect Customer Name], Customer.Mth_Year))

Thanks!

Labels (2)

• Set Analysis

1 Solution

Accepted Solutions
MVP

May be try this

```Sum(Aggr(If(Customer.Mth_Year = Min({1<Date={">=\$(=YearStart(Max({1}Date), -4))<=\$(=Date(Max({1}Date)))"}, Customer.QTR, Customer.Month, Customer.Year>}
TOTAL <[Direct/Indirect Customer], Segment, [Direct/Indirect Customer Name]> Customer.Mth_Year), 1, 0),
[Direct/Indirect Customer],Segment,[Direct/Indirect Customer Name], Customer.Mth_Year))```
2 Replies
MVP

May be try this

```Sum(Aggr(If(Customer.Mth_Year = Min({1<Date={">=\$(=YearStart(Max({1}Date), -4))<=\$(=Date(Max({1}Date)))"}, Customer.QTR, Customer.Month, Customer.Year>}
TOTAL <[Direct/Indirect Customer], Segment, [Direct/Indirect Customer Name]> Customer.Mth_Year), 1, 0),
[Direct/Indirect Customer],Segment,[Direct/Indirect Customer Name], Customer.Mth_Year))```
Creator
Author

Thanks Sunny. It's working as expected 🙂

Community Browser