Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to build sth. like the following
Presence_data:
LOAD
*,
IF(Pers_ID = PREVIOUS(Pers_ID), 1, 0)
;
LOAD
%Date,
Pers_ID
...
RESIDENT ...
ORDER BY Pers_ID asc, %Date asc
;
For the PREVIOUS() fct to work correctly and return me a proper 1/0 field that I can sum up in the chart, it is essential that the table be already sorted by these two fields.
=> Will this work in this way? Can I rely on the table being already sorted when I use such a "piggyback LOAD"?
Thanks a lot!
Best regards,
DataNibbler
Seems to work for me:
X1:
load * inline [
A,B
3,t
2,g
5,b
6,f];
X2:
load *, if(previous(A)=3,1,0) as C;
load * resident X1
order by A;
drop table X1;
But it works just fine without the preceding load too.
X1:
load * inline [
A,B
3,t
2,g
5,b
6,f];
X2:
load *, if(previous(A)=3,1,0) as C
resident X1
order by A;
drop table X1;
Seems to work for me:
X1:
load * inline [
A,B
3,t
2,g
5,b
6,f];
X2:
load *, if(previous(A)=3,1,0) as C;
load * resident X1
order by A;
drop table X1;
But it works just fine without the preceding load too.
X1:
load * inline [
A,B
3,t
2,g
5,b
6,f];
X2:
load *, if(previous(A)=3,1,0) as C
resident X1
order by A;
drop table X1;
Thanks Gysbert!
I will try.
Hi Gysbert,
seems to be working.
That helps me a great deal for now I can use for my employee_presence_chart the same dimension as for most others, which is "Mo - Sat", thereby overcoming a mayor shortcoming of our personell_database.
Thanks a lot!
Best regards,
DataNibbler