Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Re: Avg function

It doesn't like that...The previously shared script before adding the group by was fine, and now it's not...

 

Annotation 2019-11-19 140547.jpg11.jpg

Highlighted

Re: Avg function

Try to share full script of yours that shows Avg and Group By if u r trying in script?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: Avg function

Here  you go:

 

Enquiries:
LOAD

Date#(subfield(FileBaseName(),' ',7),'YYYY') as Year,
Date#(subfield(FileBaseName(),' ',6),'MMM') as Month,
Date#(subfield(FileBaseName(),' ',6)&' '&subfield(FileBaseName(),' ',7),'MMM YYYY') as MonthYear,

No.,
Description,
"Description 2",
Status,
"Last Amended",
"Global Dimension 1 Code" as "Branch",
"Enquiry Owner",
Surveyor,
"Enquiry Date",
"Survey Appointment",
"Survey Enquiry Status",
"Loss Reason Comment",
"Call Code",
"Symptom 1",
"Symptom 2",
"Symptom 3",
"Symptom 4",
("Survey Appointment"-"Enquiry Date") as "Days between Enquiry and Survey"

 


FROM [lib://Enquiry Extract/Enquiry Extract*.xlsx]
(ooxml, embedded labels, table is [Book 1]) where not "Survey Appointment" like '';



NoConcatenate
Enquiries2:
LOAD

Year,
Month,
MonthYear,
No.,
Description,
"Description 2",
Status,
"Last Amended",
"Branch",
"Enquiry Owner",
Surveyor,
"Enquiry Date",
"Survey Appointment",
"Survey Enquiry Status",
"Loss Reason Comment",
"Call Code",
"Symptom 1",
"Symptom 2",
"Symptom 3",
"Symptom 4",
"Days between Enquiry and Survey",
Interval("Survey Appointment"-"Enquiry Date", 'DD') as Days


//Avg("Days between Enquiry and Survey") as "Avg Days"
//if("Days between Enquiry and Survey"='>0',(Avg("Days between Enquiry and Survey")),'0') as "Average Days"
// avg("Days between Enquiry and Survey") as days

Resident Enquiries Group By Year,
Month,
MonthYear,
No.,
Description,
"Description 2",
Status,
"Last Amended",
"Branch",
"Enquiry Owner",
Surveyor,
"Enquiry Date",
"Survey Appointment",
"Survey Enquiry Status",
"Loss Reason Comment",
"Call Code",
"Symptom 1",
"Symptom 2",
"Symptom 3",
"Symptom 4",
"Days between Enquiry and Survey" ;

drop table Enquiries