5 Replies Latest reply on Oct 30, 2018 5:10 AM by Zhouyi Zhang

# Combine YTD calculation with count distinct

Is it possible to combine a last year or year to date formula with a count distinct. For example to see the number of orders with more than x euro sales

I tried to combine these two but it not seems to work and i can't find the solution.

IF ([WEEK_BEGIN_DATUM] <= TODAY()

AND DATEDIFF('year',[WEEK_BEGIN_DATUM],Today())= 0) THEN COUNTD(IF [sales] >0 THEN [article number]END)

• ###### 1. Re: Combine YTD calculation with count distinct

Hi, Barry

COUNTD(IF [sales] >0 and (([WEEK_BEGIN_DATUM] <= TODAY() AND DATEDIFF('year',[WEEK_BEGIN_DATUM],Today())= 0))

THEN [article number]END)

ZZ

2 of 2 people found this helpful
• ###### 2. Re: Combine YTD calculation with count distinct

COUNTD(IF ([WEEK_BEGIN_DATUM] <= TODAY()

AND DATEDIFF('year',[WEEK_BEGIN_DATUM],Today())= 0) AND  [sales] >0 THEN [article number]

END)

If the the Id's not there then the result may also come blank!

2 of 2 people found this helpful