Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 alopez
		
			alopez
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Is there a way to override set analysis? If I have a table that only looks at 2023 data but now the consumer wants to see 2022 data. Is there a way to override and include my selection?
Here is the current set analysis:
=SUM({<SALES_STATUS={'Sale'},YEAR={'2023}>} SALES_PRICE)
 Tanish
		
			Tanish
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Alopez,
Rather than using Hard Code value in the Set Analysis like
YEAR={'2023} , You can use dynamic value here like
YEAR = {"$(=Year(Max(Date)))"}
You can keep a Filter of Year at the top. By default the table will show Current Year data but, If the user select any other year then it will show that specific year data.
I hope this will help..........🙂
 BrunPierre
		
			BrunPierre
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		To filter data for the current year while excluding future years, use these modifiers
{$<Year={"$(=Year(Today()))"}, DateField = {"<=$(=Today())"}>}
 Tanish
		
			Tanish
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Alopez,
Rather than using Hard Code value in the Set Analysis like
YEAR={'2023} , You can use dynamic value here like
YEAR = {"$(=Year(Max(Date)))"}
You can keep a Filter of Year at the top. By default the table will show Current Year data but, If the user select any other year then it will show that specific year data.
I hope this will help..........🙂
 alopez
		
			alopez
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Interesting, what happens if the max year is not the current year by chance?
 BrunPierre
		
			BrunPierre
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi, such a situation could occur when the date field contains future dates. That expression takes the maximum date value from the "Date" field and extracts the year component. You can create a flag field that indicates whether a date is in the future or not, and factor in or exclude future dates in your calculations.
 alopez
		
			alopez
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		How would I use a flag for set analysis? I would be back at my original problem where I can't use the filters to update data.
 Tanish
		
			Tanish
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Then you can use Today() instead of the Max(Date) but the limitation is your date filters will not work.
 BrunPierre
		
			BrunPierre
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		To filter data for the current year while excluding future years, use these modifiers
{$<Year={"$(=Year(Today()))"}, DateField = {"<=$(=Today())"}>}
 barnabyd
		
			barnabyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		G'day @alopez,
You don't override Set Analysis. It's the other way around. The user makes selections on the data using the filters on the page but Set Analysis can override the user selections.
What are your actual requirements? People have tried to answer your questions but I think that maybe your questions are not heading in the right direction!
Cheers, Barnaby.
 alopez
		
			alopez
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The max feature is helpful for when you are working with dates.
Also using an operator for intersection was helpful as I found in another article. Set operators | Qlik Cloud Help
*=: This operator is used to define the corresponding field values based
on the intersection between what the user has selected and the values we
specify. That is, the resulting record set will be the values that "intersect" or
are present in both the user's selection and the values we explicitly define in
our element list.
