Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis not working when no selections

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 NumberCount
123453

When unfiltered:

Account NumberCount
123450
456780
987650

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?

2 Replies
sunny_talwar

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?

rubenmarin

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.