3 Replies Latest reply on Nov 27, 2018 2:53 PM by Zhouyi Zhang

# Condition in LOD Function

I want to identify those emails with their no. of bookings, who have made the bookings in both the years i.e 2017 and 2018.

Below formula does not filter out the years.

{ FIXED [Email data],YEAR([Booking Date]) = 2017 AND YEAR([Booking Date]) = 2018 : COUNTD([No. of Bookings]) }

Can anyone please help me with the correct formula?

Thanks,

Nipa

• ###### 1. Re: Condition in LOD Function

Hi, Nipa

Have you tried to change AND to OR as shown below?

{ FIXED [Email data],YEAR([Booking Date]) = 2017 OR YEAR([Booking Date]) = 2018 : COUNTD([No. of Bookings]) }

ZZ

• ###### 2. Re: Condition in LOD Function

Hi ZZ,

If I try OR then it will show the emails even if it has bookings in either of the years. But I want both the years

Thanks

Nipa

• ###### 3. Re: Condition in LOD Function

Hi, Nipa

Thanks for your explain, really helpful.

Please try below calculation and see if it works or not

Countd(

if { FIXED [Email data]:max(if YEAR([Booking Date]) = 2017 then 1 end )} = 1

and

{ FIXED [Email data]:max(if YEAR([Booking Date]) = 2018 then 1 end )} = 1 then

[No. of Bookings]

end

)

ZZ