Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all
I have following script with stockinoutindicator field while loading data from qvd now I want to give following
Condition
============================
(Today()-max([Posting Date])) as [Exp Days Items]
where StockInOutIndicator = '1'
============================
in same qvd file how to achive this can any one help in this matter.
Script
=============================
ValueEntry_IAL:
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
[Source QVDs NAV\Value_Entry.qvd]
(qvd);
Hi,
You can use a preceding load, something like:
ValueEntry_IAL:
LOAD *,
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,
... // rest of the fields here
FROM
[Source QVDs NAV\Value_Entry.qvd]
(qvd);
Hope that helps.
Miguel
Thanks for prompt reply I will get back you.
Miguel,
I think Max function will not work while loading with other fields without GroupBy.
Vikasmahajan,
The below code will help you, but make sure Today()-$(vMaxPD) should me in same format
MaxPDTable:
LOAD
max([Posting Date]) as MaxPD
FROM
[Source QVDs NAV\Value_Entry.qvd]
(qvd);
LET vMaxPD = Peek('MaxPD',-1,'MaxPDTable');
ValueEntry_IAL:
LOAD *,(Today()-$(vMaxPD)) as [Exp Days Items]
Where StockInOutIndicator=1;
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
[Source QVDs NAV\Value_Entry.qvd]
(qvd)
;
Cheers!!
Jagan
you are wright...
Thanks Mr.Jagan I will try let you know the status...
Vikas
I have attached QV1.qvw file , Please it is loading only 3 records who have
StockInOutIndicator = 1 , but i want all the 4 records load all data with exp days.
Please reply
Thanks
Vikas
Hello,
Can you attach sample data file(i.e. xyz.qvd).
Thanks,
Jagan
I have attached the qvd ,
pls reply.
Sorry I didn't seen Inline table. Ok see this image
For max date your StockInOutIndicator gives you zero value. When we are loading the table with condition Where StockInOutIndicator we can see only 3 records.
Cheers!!
Jagan
cAN WE SHOW ALL 4 RECORDS AT A TIME ?