Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Measure - Previous Day

Trying to create a measure that will count the orders from previous day.  Basically, if used in table, it should look as follows, referencing the current day to check order ids from previous day:


Date          Value

9/17/2018  (Order Count from 9/16/2018)

9/16/2018  (Order Count from 9/15/2018)

9/15/2018  (Order Count from 9/14/2018)... so on


I have an expression so far:


count(DISTINCT{$<[completed_date.autoCalendar.Date]={"$(=Date(max([completed_date])-1))"}>}([order_id]))


but this expression does not correctly do this, instead, this expression would produce the following when used in table:


Date          Value

9/17/2018  0

9/16/2018  (Order Count from 9/16/2018)

9/15/2018  0    ....  so on...


Any way I could change this expression to get the desired table?


1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I could probably give you an answer after looking at your data model. but first I might suggest a different approach to the problem.

The function Below() can be useful here.

=Below(Count(order_id))

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com