Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
olks
Partner - Contributor II
Partner - Contributor II

Calculate YTD

Hello, 

I am trying to calculate YTD sales which is the range from 1st of jan of the maxdate until the end of maxdate.

This is the expression that I input into the measurement. 

Sum({$<OrderDate={'>=$(=YearStart(Max(OrderDate)))'}>}Sales)

However, the return value was 0 when I added the symbol "more than and equal(>=)" into the expression.

While I need the expression to return me a value of a summation of Sales from 1st jan until maxdate.

 

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try changing your quotation from single to double.

Sum({$<OrderDate={">=$(=YearStart(Max(OrderDate)))"}>}Sales)

View solution in original post

2 Replies
Vegar
MVP
MVP

Try changing your quotation from single to double.

Sum({$<OrderDate={">=$(=YearStart(Max(OrderDate)))"}>}Sales)

Vegar
MVP
MVP

In order to create a YTD statement you should even add an upper limit of the date interval to your expression. Like this:

Sum({$<OrderDate={">=$(=YearStart(Max(OrderDate)))<=$(=max(OrderDate))"}>}Sales)