Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Need Help - Date Range Calclulation

  hi All:

The existing questions in the forum got me this far (thanks to all previous posts), however I am stuck.

I have an existing calculating that gives me YTD Sales thru Current Week, I am trying to do same thing but for last year and I am striking out. See below.


// Trying to get sales thru current week for last year.  I got it to work for current, but having issues for last

// These are my revised date statements and yield the dates I want



//New Code for LAST YEAR

SUM({$<KEY_DATE = {'>=$(=addmonths(=YearStart(Today()),-12))<=$(=AddMonths(=WeekEnd(Today()),-12)}>}[Invoice Subtotal])


// SUM({$<KEY_DATE = {'>=$(=YearStart(Today()))<=$(=WeekEnd(Today()))'}>}[Invoice Subtotal])

1 Reply

Re: Need Help - Date Range Calclulation

May be this:

Sum({$<KEY_DATE = {'>=$(=YearStart(Today(), -1))<=$(=WeekEnd(AddYears(Today(), -1)))'}>}[Invoice Subtotal])


Sum({$<KEY_DATE = {'>=$(=YearStart(Today(), -1))<=$(=AddYears(WeekEnd(Today()), -1))'}>}[Invoice Subtotal])

Community Browser