Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jonaguada
Contributor III
Contributor III

Change in behavior in SET analysis when upgraded to May 2021

The following code used to provide Sales total for the current YTD. 

sum( { $ <Year= {$(=max(Year))},PeriodDate= {"<=$(today()-1)"}> } Sales)  

 

It stopped working once we upgraded to Qlikview May 2021

 

The only thing that worked was to modify the set analysis to use an intersection of two set identifiers instead of one

sum( { $ <Year= {$(=max(Year))}>*<PeriodDate= {"<=$(today()-1)"}> } Sales)  

 

Would anyone know why the two formulas above act differently?  

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

Just use below 

Current year YTD 

=sum( { $ <PeriodDate= {">=$(=Date(yearstart(Max(PeriodDate))))<=$(=Date(Max(PeriodDate)))"}> } Sales)  

 

Previous year YTD 

=sum( { $ <PeriodDate= {">=$(=Date(yearstart(Max(PeriodDate),-1)))<=$(=Date(Addyears(Max(PeriodDate),-1)))"}> } Sales)  

 

 

In regards to your expressions

Today()-1. Will return a number, it needs be formatted as date 

$(=Date(today()-1)) 

Your second expression is also actually not working, but just seems like it's working 

You may already know * returns intersection of sets

<Year= {$(=max(Year))}> //returns all data for max year

* << Interesect

<PeriodDate= {"<=$(today()-1)"}>  // this set is actually returning everything because its comparing date with numeric value 

So actually the intersection and year =max(year) is the only thing working

 

 

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.