Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Uzumaki_N
Contributor III
Contributor III

YTD calculation in set expression

Uzumaki_N_0-1680192758908.png

How are these fields working? Year =,Month=,Week=,DateField=,

I found it is used to ignore the selection, but for me, I am able to select from these fields.

Please explain how these fields are working.

 

 

1 Reply
Lisa_P
Employee
Employee

They will be applied to the Sum(Sales) aggregation, but not to the others, so you would need to apply these at each aggregation to be ignored by all. See example below ..

Sum(
{<Year=, Month=, Quarter=, DateField=, DateNum={">=$(=Num(YearStart(Max({<Year=, Month=, Quarter=, DateField=>}DateNum))))<=$(=Max({<Year=, Month=, Quarter=, DateField=>}DateNum))"}>}
Sales)

or create a variable for this combination of fields and use that

eg vDates               Year=, Month=, Quarter, Week, DateField=

and change your expression to

Sum(
{<$(vDates), DateNum={">=$(=Num(YearStart(Max({<$(vDates)>}DateNum))))<=$(=Max({<$(vDates)>}DateNum))"}>}
Sales)