Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to get max date from script depending upon current selection of calender date

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 1Header 2Header 3Header 4
MATNRKEYBatchDateQty
112322/1/201420
145618/2/201520
178924/4/201520

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.

15 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: How to get max date from script depending upon current selection of calender date

Current selections are not available during the load. So there are no current selections that can be used in the script.


talk is cheap, supply exceeds demand
Highlighted
Not applicable

Re: How to get max date from script depending upon current selection of calender date

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

Highlighted
Not applicable

Re: How to get max date from script depending upon current selection of calender date

cane we handle it in expression side

Highlighted
MVP & Luminary
MVP & Luminary

Re: How to get max date from script depending upon current selection of calender date

Another method to fetch the min/max value from a field: “Fastest” Method to Read max(field) From a QVD | Qlikview Cookbook.

- Marcus

Highlighted
Partner
Partner

Re: How to get max date from script depending upon current selection of calender date

Please check this and let me know if you have any questions.

Cheers,

Naresh

Highlighted
Not applicable

Re: How to get max date from script depending upon current selection of calender date

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

Highlighted
Partner
Partner

Re: How to get max date from script depending upon current selection of calender date

Did you try the document which I have given? It is working fine.

Cheers,

Naresh

Highlighted
Not applicable

Re: How to get max date from script depending upon current selection of calender date

Hello Naresh,

I didn't get any document can you send it again.

Highlighted
Partner
Partner

Re: How to get max date from script depending upon current selection of calender date

Please check this