Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have Batch date from script but I want to pull latest date from script depending upon current selection. Please refer the following ex:
EX:
Header 1 | Header 2 | Header 3 | Header 4 |
---|---|---|---|
MATNR | KEY | BatchDate | Qty |
1 | 123 | 22/1/2014 | 20 |
1 | 456 | 18/2/2015 | 20 |
1 | 789 | 24/4/2015 | 20 |
In above example : MATNR 1: I have 3 keys and 3 dates but with same qty. Now In calender I have selcted 2015 Apr.
So in that case I want only 1 row that is last row as it is nearer to my selection date.
How to handle this in script side only, so How to write a script for that.
Current selections are not available during the load. So there are no current selections that can be used in the script.
use below script it will give max date
load
MATNR,
Qty
max(BatchDate) as BatchDate resident table group byMATNR,Qty;
and let me know if it is working or not or else provide data
Thanks
Manju
cane we handle it in expression side
Another method to fetch the min/max value from a field: “Fastest” Method to Read max(field) From a QVD | Qlikview Cookbook.
- Marcus
Please check this and let me know if you have any questions.
Cheers,
Naresh
It will work for irrespectiove of current selection.
It means in your solution it will give me 25 Apr 2015 but if i select Jan 2015 then in that case I want first record i.e,
22 Jan 2015
Did you try the document which I have given? It is working fine.
Cheers,
Naresh
Hello Naresh,
I didn't get any document can you send it again.
Please check this