Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Attend QlikWorld 2020 and hear keynote speaker, Malcolm Gladwell. Register by February 29th to save $200. Learn More
Highlighted
maniram23
Contributor II

Re: only load first date

Hi,

please chech this one.

t1:

LOAD * INLINE [

Date   ,  number    , value

2/5     ,     1  ,             5

10/4     ,   1  ,             5

12/5      ,  1 ,              5

];

load *,

'' as zero

Resident t1 where Date=peek('Date',0,'t1') Order BY Date ;

DROP Table t1;

DROP Field zero;

Highlighted
Not applicable

Re: only load first date

jep but these are just examples the date doesn't matter i just want the first delivery of a product at a location.

Highlighted
Not applicable

Re: only load first date

hi mani,

thx for ur answer but pls check my add under jose's/arul's comment.

and my question is what u want to with ('' as zero ) or what do u mean with this.

Highlighted
jsenivifor
New Contributor III

Re: only load first date

Hi Eric,

Let me send you the code with any changes, I've tried it and it seems to work.

temp:

NOCONCATENATE

load articlnumber,

     location,

    amount,

     Date_VD as delivery_date

Resident Vd_TAB

where "typ" ='delivery';

left join

load articlnumber,

     location,

     Date_VD as sale_date

     Resident Vd_TAB

where "typ" ='salef';

drop table Vd_TAB;

aux:

first 1 load min(date(delivery_date),'DD/MM/YYYY') as date_min

resident temp;

let vMin = peek('date_min',0,'aux');

Vd:

first 1 Load  articlnumber,

    location,

     delivery_date,

     sale_date,

     sale_date-delivery_date as diffdate

resident temp

where sale_date-delivery_date >=0 and delivery_date ='$(vMin)';

drop table temp;

Regards,

Highlighted
maniram23
Contributor II

Re: only load first date

Hi,

it will also work  "jose's/arul's comment ."


zero is new derived value..


that is not required thing.


when we are taking resident of all data of upper table. than it will not give proper data that so i was taken "NEW DERIVED VALUE"





Highlighted
Not applicable

Re: only load first date

thanks for u help again.

But now there are some locations and articles with no diffdate and delivery/sale date.

I think the problem is at first 1 load because it only seem to load the first date it finds in the table.

So i tried around with firstsortedvalue, but then qlik sense gives out errors everytime.