Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hmjason7
Contributor II
Contributor II

Issue with dates in set analysis

Hello,

I want to create some set analysis expressions in order to do Current YoY and Previous YoY date comparisons on the fly.

I have defined these 4 variables in my load script:

Set vCurrentYTDStart = Date(YearStart($(vCurrentYTDEnd)), 'DD/MM/YYYY');

Set vCurrentYTDEnd = Date(Max([Trade Date]), 'DD/MM/YYYY');

Set vPreviousYTDStart = Date(AddYears($(vCurrentYTDStart), -1), 'DD/MM/YYYY');

Set vPreviousYTDEnd = Date(AddYears($(vCurrentYTDEnd), -1), 'DD/MM/YYYY');

 

So if a user selects a Trade date, then the dates would change depending on the selection.

But my set analysis expression below isn't working. Any ideas? Currently using a recent version of Qlik Sense.

 

Sum({$<[Trade Date] = {">=$(=$(vCurrentYTDStart))<=$(=$(vCurrentYTDEnd)))"}>} [Sales])

 

 

 

Labels (3)
1 Solution

Accepted Solutions
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Check how you dates are formatted.

If you think that's not the issue, please upload sample data.

 

 

 

View solution in original post

1 Reply
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Check how you dates are formatted.

If you think that's not the issue, please upload sample data.