Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have an expression that I use to count up the distinct number of Classes per Account Number. In this expression i've included a piece of Set Analysis that limits the results down to only the last 12 months. My expression is below:
=count({<Date = {"$(='>=' & Date(AddYears(Max(Date),-1)))"}>} DISTINCT Class)
At first I thought this was working fine however it seems that it only actually returns values when the records are being filtered down by Account Number, meaning the results I get are along the lines of:
When filtered by Account Number = 12345
Account Number | Count |
---|---|
12345 | 3 |
When unfiltered:
Account Number | Count |
---|---|
12345 | 0 |
45678 | 0 |
98765 | 0 |
I've narrowed it down to the problem being in the Set Analysis that is narrowing down the date ranges, as it returns values when this is not included, however i'm not sure why it's failing to evaluate it when there are no selections.
Can someone help point me in the right direction?
I hope you don't have a different max date for each of the account number? Set analysis doesn't take place on row by row basis.
Can you share a sample to show the issue?
Hi James, an easy way to check the final expression is removing the label for the 'Count' column, this way the expression label will change to the expression and you can check the set analisys applied to Date only hovering over the title.