Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Karahs
Partner - Creator
Partner - Creator

Expression in load script

Hello Everyone,

How will i use the folllowing formula in load script?

networkdays(Avg({<StatusName={'On pilot'}>}CreatedDate),Avg({<StatusName={'Pilot Ok'}>}ceateddate))

Thanks in advance

2 Replies
rohitk1609
Master
Master

Hi Kshitija,

Aggregate functions doesn't work in script editor . Please try to use it in calculated measure.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Rohit Kumar

jonathandienst
Partner - Champion III
Partner - Champion III

I assume the CreatedDate is the correct name for 'createddate;. Remember that QV field names are case sensitive.

In s standalone load:

LOAD NetWorkDays(Avg(If(StatusName = 'On pilot', CreatedDate)) Avg(If(StatusName = 'Pilot Ok', CreatedDate))) as WorkDays

FROM ...

If you are also loading other fields, then non-aggregated fields will need to be in a Group By clause:

LOAD NetWorkDays(Avg(If(StatusName = 'On pilot', CreatedDate)) Avg(If(StatusName = 'Pilot Ok', CreatedDate))) as WorkDays,

  Division,

  Period,

  ...

FROM ...

Group By Division,

  Period,

  ...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein