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: 
cfountain72
Creator II
Creator II

Variables in Set Analysis Expressions

Hello,

I'm trying to use a variable in my set analysis, but am either getting an error, or no results, or everything. Here is my expression where vCalendarSelection is variable (it's a date which is either a Fiscal or Calendar start date, based on a filter selection):

=Sum({$<FPMeasureDate={"$(= '>=' & Date(Max(vCalendarSelection)) & '<=' & Date(Max(FPMeasureDate)) )"}>} FPValue)

Any suggestions?

Thanks in advance,

Chris

2 Replies
dwforest
Specialist II
Specialist II

if its a variable needs a $() around it

=Sum({$<FPMeasureDate={"$(= '>=' & Date(Max($(vCalendarSelection))) & '<=' & Date(Max(FPMeasureDate)) )"}>} FPValue)

I think you could also use:

=Sum({$<FPMeasureDate={">=Date(Max($(vCalendarSelection)))<=Date(Max(FPMeasureDate))"}>} FPValue)

Date vars in Set Analysis can be tricky. The field FPMeasureDate must be in your default Date Format 

cfountain72
Creator II
Creator II
Author

Thanks...however, neither of those are working for me. They both yield sums of 0. Any other ideas?