If(StockInOutIndicator = 1, Today() - Max([Posting Date]) ) AS [Exp Days Items];
LOAD *,
if([Valued Quantity] >= 0 AND
((Entry_Type = 0 AND Doc_Type = 5)
OR (Entry_Type = 1 AND Doc_Type = 3)
OR (Entry_Type = 2)
OR (Entry_Type = 4 AND Doc_Type = 10)
OR (Entry_Type = 4 AND Doc_Type = 0)
OR (Entry_Type = 6)),1,0) AS StockInOutIndicator
FROM
(qvd);
Hope this resolve your issue. If the issue is solved please mark the answer with Accept as Solution & like it. If you want to go quickly, go alone. If you want to go far, go together.