Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hiya,
I'm creating a script and want to do the average days between enquiry and survey.
I've loaded in my data and created the metric of (Survey Date-Enquiry Date) as Days between survey and Enquiry
I've then noconcatenated this and loaded it again as a proper field.
Then tried to do
Avg(Days between Enquiry and Survey) as Avg Days.
When I load this in it kicks up a fuss.
Does anyone know what I'm doing wrong?
Thanks
Try this?
Avg(Interval(Survey Date-Enquiry Date, 'DD')) as Days
I'm getting the same error of 'invalid expression' 😔
What this is returning?
Interval(Survey Date-Enquiry Date, 'DD')
That bit loads in fine and is giving me the correct data. as per the photo.
Aggregate functions such as Avg, Sum, Min, Max etc need group by clause... are you using one when you do Avg()?
Sorry, I don't understand what you mean by a clause..
In my data load I tried doing this:
Resident Enquiries, group by Branch
(All formatted correctly) which it didn't like, is that what you mean?
That is what I meant, but what all fields and expressions did you have within Load?
This is what I have tried, and the greyed out attempts didn't work with it like this.
Group by needs to include all the fields that are listed outside of aggregation... so, Year, Month, MonthYear etc will all need to go into Group By or you need to remove all fields except Brand from your Load...