Discount on a sale

I have a Discounts table, with the date, catalog id, and discount fields; the discount must be applied until the date indicated in the table. In the sales table, I need that when I select the catalog id, look in the discount table if it has a discount and place it in the DISCOUNT field. I used this expression but it doesn’t work for me:

if (TODAY () <= LOOKUP ([CATALOG ID] = [_ THISROW]. [CATALOG ID], Discounts, DISCOUNT ID, DATE), LOOKUP (MAXROW (“Discounts”, “DATE”, [CATALOG ID] = [_ THISROW ]. [CATALOG ID]), “Discounts”, “DISCOUNT ID”, “DISCOUNT”), 0)

THANKS FOR THE SUPPORT

Solved Solved
0 2 114
1 ACCEPTED SOLUTION

You’re right Steve, thank you very much.

View solution in original post

2 REPLIES 2

Steve
Platinum 4
Platinum 4

You’re using LOOKUP() wrong.

You’re right Steve, thank you very much.

Top Labels in this Space