Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Mohanish1
Contributor
Contributor

Need a Solution on how to use multiple columns in GROUP BY clause.

I want to group the data by the columns "Meeting_Number" and "Agenda_of_Meeting". I want the count of unique meetings which in this case must be 9.

Expected Output : 

1 testing 
1 Labour
1 Holiday
1 work
1 Hiring
1 Promotion
1 Loss
1 Profit
2 testing 

 

Data :

Meeting Number  Agenda
1 testing 
1 testing 
1 testing 
1 testing 
1 testing 
1 testing 
1 testing 
1 testing 
1 Labour
1 Labour
1 Labour
1 Labour
1 Labour
1 Labour
1 Labour
1 Labour
1 Holiday
1 Holiday
1 Holiday
1 Holiday
1 Holiday
1 Holiday
1 Holiday
1 Holiday
1 work
1 work
1 work
1 work
1 work
1 work
1 work
1 work
1 Hiring
1 Hiring
1 Hiring
1 Hiring
1 Hiring
1 Hiring
1 Hiring
1 Hiring
1 Promotion
1 Promotion
1 Promotion
1 Promotion
1 Promotion
1 Promotion
1 Promotion
1 Promotion
1 Loss
1 Loss
1 Loss
1 Loss
1 Loss
1 Loss
1 Loss
1 Loss
1 Profit
1 Profit
1 Profit
1 Profit
1 Profit
1 Profit
1 Profit
1 Profit
2 testing 
2 testing 
2 testing 
2 testing 
2 testing 
2 testing 
2 testing 

 

Query Used :

Agenda_Count_For_Meeting_More_Than_120_Mins:
LOAD

"Meeting Number" as Meeting_Number,
Agenda as Agenda_of_Meeting,

"Duration in (min)" as Duration_of_Meeting
Resident Board_Meetings Where "Duration in (min)" >= 120 Group By Meeting_Number,Agenda_of_Meeting;

 

Error :

The following error occurred:
Aggregation expressions required by GROUP BY clause.
 
The error occurred here:
Agenda_Count_For_Meeting_More_Than_120_Minutes: LOAD "Date of meeting" as Date_of_Meeting, "Meeting Number" as Meeting_Number, Agenda as Agenda_of_Meeting, "Agenda Status" as Agenda_Status, "Date when Agenda was Notified" as Date_Agenda_Notified, "Duration in (min)" as Duration_of_Meeting, "Member CAT" as Meeting_Category, Attendence as Attendance_in_Meeting, Name as Name_of_Officials, PAN as PAN_of_Officials, Voting as Voting_by_Officials Resident Board_Meetings Where "Duration in (min)" >= 120 Group By Meeting_Number,Agenda_of_Meeting
Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Hi,

Count({<Duration_of_Meeting= {">=120"}> } DISTINCT Meeting_Number)

But , if it has to be done in the backend, maybe like this.

Agenda_Count_For_Meeting_More_Than_120_Minutes:
LOAD Max("Date of meeting") as Date_of_Meeting,
Count(DISTINCT "Meeting Number") as Meeting_Number,
Agenda as Agenda_of_Meeting,
Only("Agenda Status") as Agenda_Status,
Only("Date when Agenda was Notified") as Date_Agenda_Notified,
Only("Duration in (min)") as Duration_of_Meeting,
Only("Member CAT") as Meeting_Category,
Only(Attendence) as Attendance_in_Meeting,
Only(Name) as Name_of_Officials,
Only(PAN) as PAN_of_Officials,
Only(Voting) as Voting_by_Officials

Resident Board_Meetings
Where "Duration in (min)" >= 120
Group By Agenda;

View solution in original post

4 Replies
PrashantSangle

just do it in front end

take straight table

dimension > Agenda_of_Meeting

Expression > count (distinct Meeting_Number)

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
BrunPierre
Partner - Master
Partner - Master

Hi,

Count({<Duration_of_Meeting= {">=120"}> } DISTINCT Meeting_Number)

But , if it has to be done in the backend, maybe like this.

Agenda_Count_For_Meeting_More_Than_120_Minutes:
LOAD Max("Date of meeting") as Date_of_Meeting,
Count(DISTINCT "Meeting Number") as Meeting_Number,
Agenda as Agenda_of_Meeting,
Only("Agenda Status") as Agenda_Status,
Only("Date when Agenda was Notified") as Date_Agenda_Notified,
Only("Duration in (min)") as Duration_of_Meeting,
Only("Member CAT") as Meeting_Category,
Only(Attendence) as Attendance_in_Meeting,
Only(Name) as Name_of_Officials,
Only(PAN) as PAN_of_Officials,
Only(Voting) as Voting_by_Officials

Resident Board_Meetings
Where "Duration in (min)" >= 120
Group By Agenda;

marcus_sommer

You need to apply the origin field-names within the group by and not the renamed ones.

Mohanish1
Contributor
Contributor
Author

Thank you!!

The backend solution worked.