Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for
Did you mean:
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)
• ### Application Development

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.
Community Browser