Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

creating new field

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

7 Replies
maxgro
MVP
MVP

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)

Not applicable
Author

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

maxgro
MVP
MVP

replace the inline load

with the load from your data

Table1:

load

     week,

     ......,

     .......

from

     yourfile

;

Not applicable
Author

Like this?

Table1:

load

     week,

     date(min(Week)) as Week#

     ......,

     .......

from

     yourfile

Not applicable
Author

Hi

Try this

Table2:

Load Week,

         Date(peek('Week',0)) as Week#

Resident Table1;

Anonymous
Not applicable
Author

load

Date(min(week) as week#,

*

   from Table 1;

maxgro
MVP
MVP

// 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;