Hello,
I am trying to create a slice that will select cars that have:
Below is the slice expression that I wrote. The expression is not quite capturing the correct records.
AND
(OR([RentalStatusID]=2,[RentalStatusID]=5,[RentalStatusID]=3),
OR((AND([RentalDate] >= (TODAY() - 14),[RentalDate] <= TODAY())),
AND([RentalDate] <= (TODAY() + 7),[RentalDate] <= TODAY())))
Any ideas?
Thanks,
Alex
Solved! Go to Solution.
Thank you Marc and Steve,
After I changed the
โ [RentalDate] <= TODAY()โ
to
[RentalDate] >= TODAY()
, at the end of expression, the formula worked.
Marcโs expression worked as well. I learned something new with the LIST expression.
Maybe this?
AND(
IN( [RenstalStatusID] , LIST( 2,3,5 ) ) ,
[RentalDate] >= TODAY()-14 ,
[RentalDate] <= TODAY()+7
)
Hereโs your expression reformatted for clarity:
AND(
OR(
([RentalStatusID] = 2),
([RentalStatusID] = 5),
([RentalStatusID] = 3)
),
OR(
AND(
([RentalDate] >= (TODAY() - 14)),
([RentalDate] <= TODAY())
),
AND(
([RentalDate] <= (TODAY() + 7)),
([RentalDate] <= TODAY())
)
)
)
The logic expressed above is:
...
The rental status ID is 2, 3, or 5....
At least one of these must be true:......
Both of these must be true:.........
The rental date is on or after two weeks ago..........
The rental date is on or before today.......
Both of these must be true:.........
The rental date is on or before a week from today..........
The rental date is on or before today.Looks to me like (8) and (9) arenโt quite right: if (8) is true, (9) is always true, as today is always on or before a week in the future. Perhaps this is the problem?
Thank you Marc and Steve,
After I changed the
โ [RentalDate] <= TODAY()โ
to
[RentalDate] >= TODAY()
, at the end of expression, the formula worked.
Marcโs expression worked as well. I learned something new with the LIST expression.
User | Count |
---|---|
37 | |
31 | |
29 | |
22 | |
18 |