Why does nth_value only return a result for a few lines of data?
I have a query that is designed to give a due date ~3 business days after the order was received. I have 1 table that has the order information in it and another table that lists out all the days, the products, the place produced, and a flag to indicate if it is a business day for that combination. I have asked for help with this before and I was directed to using nth_value, however out of 34k lines for 1 days worth of data, it returns 7 lines where the due date is not null (and 3 of those lines have the incorrect value in them). I am not understanding what I have done wrong, so I am hoping that someone might be able to help me understand this function better or give me another idea of how to accurately give a due date that varies on a day, product, and place produced basis.