• Charlone Gianan 1
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi Guys!

Can someone assist me on how can I get the contact record sorted (Descending -> Proficiency) and (Ascending -> Skill Type) based on my query below. 

Employee Skills, Training and Certifications has a lookup relationship with Contact (Employee).

SELECT Name, Email
, (SELECT Skill_ID__r.Name, Proficiency__c, Year_of_Experience__c, Skill_Type__c FROM Employee_Skills__r)
, (SELECT Training_ID__r.Name FROM Employee_Training__r)
, (SELECT Certification_ID_r.Name FROM Employee_Certifications__r)
FROM Contact

Thank you! 
Hello. Can you guys help me how can I group query results based on the number of filters matched. 
For example, I have 5 filters then I am looking for (5 skills), 'Apex' , 'Lightning' , 'Visualforce', 'HTML' and 'Java'. These skills is from lookup relataionship(Employee_Skills__c) to Contact(renamed - Employee). 

The result should display in a table like this.
5 matches out of 5 filters
4 matches out of 5 filters
3 matches out of 5filters
2 matches out of 5 filters
1 match out of 5 filters

Here's my soql:
SELECT Name, Email, (SELECT Skill_ID__r.Name, Proficiency__c, Year_of_Experience__c FROM Employee_Skills__r), (SELECT Training_ID__r.Name FROM Employee_Training__r), (SELECT Certification_ID__r.Name FROM Employee_Certifications__r) FROM Contact
 
Can you guys help me how can I sort this subquery Descending? I tried to put ORDER BY DESC but nothing happen. 
Employee_Skills__c (lookup from Contact(Employee)).
SELECT Name, (SELECT Skill_ID__r.Name, Proficiency__c FROM Employee_Skills__r) FROM Contact

 for (Employee_Skills__c setSkill1 : [SELECT Employee_ID__c FROM Employee_Skills__c WHERE (Skill_ID__r.Name LIKE :'%' + skillName + '%') AND (Proficiency__c >= :proficiency.left(1)) AND (Year_of_Experience__c  LIKE :yearsOfExperience + '%') ORDER BY Proficiency__c DESC ] ) {
                skill1.add(setSkill1.Employee_ID__c);                                                         
 }              
              
Can you guys help me how can I sort this subquery Descending? I tried to put ORDER BY DESC but nothing happen. 
Employee_Skills__c (lookup from Contact(Employee)).
SELECT Name, (SELECT Skill_ID__r.Name, Proficiency__c FROM Employee_Skills__r) FROM Contact

 for (Employee_Skills__c setSkill1 : [SELECT Employee_ID__c FROM Employee_Skills__c WHERE (Skill_ID__r.Name LIKE :'%' + skillName + '%') AND (Proficiency__c >= :proficiency.left(1)) AND (Year_of_Experience__c  LIKE :yearsOfExperience + '%') ORDER BY Proficiency__c DESC ] ) {
                skill1.add(setSkill1.Employee_ID__c);                                                         
 }