Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Set Analysis with Date Variables

Hi new here so apologies if others have answered this one - 

sum(
{<YearMonth,YearMonth={'>= $(vYearMonth2PrevToData) <= $(vYearMonthToData) '}>}
Amount)

The variable names aren't great but they are to drive the date back to when the data corresponds and they seem to be working fine in terms of matching the right date - however this sum results in 0 despite everything showing correct

OK - SUM({YearMonth,YearMonth={'>=20151 <=20153'}>}Amount)

If I just use one or the other variable it provides the answer so it has to have something to do with me trying to define the range to do the sum over.

Any help appreciated - even the learning I am doing suggests I have everything correct

Labels (3)
1 Solution

Accepted Solutions
Highlighted

Re: Set Analysis with Date Variables

Can you try this

Sum({<YearMonth = {"$(='>=' & vYearMonth2PrevToData & '<=' & vYearMonthToData)"}>} Amount)

or

Sum({<YearMonth = {"$(='>=' & $(vYearMonth2PrevToData) & '<=' & $(vYearMonthToData))"}>} Amount)

 

View solution in original post

3 Replies
Highlighted

Re: Set Analysis with Date Variables

Can you try this

Sum({<YearMonth = {"$(='>=' & vYearMonth2PrevToData & '<=' & vYearMonthToData)"}>} Amount)

or

Sum({<YearMonth = {"$(='>=' & $(vYearMonth2PrevToData) & '<=' & $(vYearMonthToData))"}>} Amount)

 

View solution in original post

Highlighted
Contributor
Contributor

Re: Set Analysis with Date Variables

Thank you so much Sunny for the quick reply - both seem to be working fine. 

Any reason why I had to define them as strings or in-case I have used the wrong terminology '>='

Highlighted

Re: Set Analysis with Date Variables

You can try this also

Sum({<YearMonth = {">=$(=vYearMonth2PrevToData)<=$(=vYearMonthToData)"}>} Amount)

or

Sum({<YearMonth = {">=$(=$(vYearMonth2PrevToData))<=$(=$(vYearMonthToData))"}>} Amount)