Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

QTD and QTD Previous Year Calcs

Can anyone tell me why these expressions aren't working?

QTD:

sum(if([Date] = QuarterStart(Today())

AND year(Date) = year(Today())

,Value))

Same Quarter Previous Year:

sum(if(DayNumberOfYear([Date]) <= DayNumberOfYear(Today())

AND [Date] = QuarterStart(Today())

AND year(Date) = year(Today())-1

,Value))

And if anyone has an idea of what will work, I am all ears.

I've been working on this forever it seems and can't figure it out. I need QTD values and same quarter last year values but can't seem to get it to work.

Thanks
Jared

1 Reply
Luminary
Luminary

QTD and QTD Previous Year Calcs

Jared,

Try

sum(if(Date>=QuarterStart(Today()) and Date<=QuarterEnd(Today()), Value))

Since QuarterStart() and QuarterEnd() return a full date with year, you don't have to compare year.

The same quarter previous year would be:

sum(if(Date>=QuarterStart(Today(),-4) and Date<=QuarterEnd(Today(),-4), Value))

Karl