Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi com,
i want the load script to only load the first date out of several which all have the same characteristics besides the date!
example
date number value
2/5 1 5
10/4 1 5
12/5 1 5
so i only want 2/5 to be loaded and not all
hope u can help me
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;
jep but these are just examples the date doesn't matter i just want the first delivery of a product at a location.
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.
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,
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"
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.