Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a field Week field that I want to use to create a new field in my chart. I want to pick the first week in the table and use that for another field. For example:
I have the below fields.
Table 1:
Week:
9/1/2014
9/8/2014
9/15/2014
9/22/2014
9/29/2014
I want to create another field in the same table called Week# where I want to select the lowest (9/1/2014 in this example) date. So it should look like,,
Table 1:
Week#, Week,
9/1/2014, 9/1/2014
9/1/2014, 9/8/2014
9/1/2014, 9/15/2014
9/1/2014,9/22/2014,
9/1/2014, 9/29/2014
in script?
Table1:
load * inline [
Week
9/1/2014
9/8/2014
9/15/2014
9/22/2014
9/29/2014
];
Left join (Table1) load
date(min(Week)) as Week#
resident Table1;
in chart
min({1} total Week)
or
min(total Week)
But the field will change over time, will this work with an 'Inline load' so when it is October and the first date available is 10/6/2014, the lowest field for week# should be 10/6/2014
replace the inline load
with the load from your data
Table1:
load
week,
......,
.......
from
yourfile
;
Like this?
Table1:
load
week,
date(min(Week)) as Week#
......,
.......
from
yourfile
Hi
Try this
Table2:
Load Week,
Date(peek('Week',0)) as Week#
Resident Table1;
load
Date(min(week) as week#,
*
from Table 1;
// no field Week#, just the fields from your file or table
Table1:
load
Week,
......,
.......
from
yourfile
;
// here the new field Week#
Left join (Table1) load
date(min(Week)) as Week#
resident Table1;