this commands for :
performance of employee
SELECT s.actualvalue / 100000 AS actualvalue, s.actualclosedate, s.new_productsubcategoryname, s.owneridname, ss.targetmoney / 100000 AS targetmoney,
ss.goalowneridname, ss.title
FROM (SELECT actualvalue, actualclosedate, new_productsubcategoryname, owneridname
FROM FilteredOpportunity) AS s RIGHT OUTER JOIN
(SELECT targetmoney, goalowneridname, title
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')) AS ss ON s.new_productsubcategoryname = ss.title AND s.owneridname = ss.goalowneridname
employee performance on product:
SELECT owneridname, new_productsubcategoryname, estimatedclosedate, estimatedvalue / 100000 AS estimatedvalue, customeridname
FROM FilteredOpportunity
employee performance on region wise
SELECT s.actualamt / 100000 AS actualamt, s.owneridname, s.actualclosedate, s.statuscode, ss.targetamt / 100000 AS targetamt, ss.goalowneridname, b.fullname,
b.businessunitidname
FROM (SELECT fullname, businessunitidname
FROM FilteredSystemUser) AS b LEFT OUTER JOIN
(SELECT SUM(actualvalue) AS actualamt, owneridname, actualclosedate, statuscode
FROM FilteredOpportunity
GROUP BY owneridname, actualclosedate, statuscode) AS s ON s.owneridname = b.fullname RIGHT OUTER JOIN
(SELECT SUM(targetmoney) AS targetamt, goalowneridname
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')
GROUP BY goalowneridname) AS ss ON s.owneridname = ss.goalowneridname
product on region wise:
SELECT actualamt / 100000 AS actualamt, owneridname, actualclosedate, statuscode, targetamt / 100000 AS targetamt, goalowneridname, title, fullname,
businessunitidname
FROM (SELECT s.actualamt, s.owneridname, s.actualclosedate, s.statuscode, ss.targetamt, ss.goalowneridname, ss.title, b.fullname, b.businessunitidname
FROM (SELECT fullname, businessunitidname
FROM FilteredSystemUser
WHERE (fullname IS NOT NULL)) AS b LEFT OUTER JOIN
(SELECT SUM(actualvalue) AS actualamt, owneridname, actualclosedate, statuscode
FROM FilteredOpportunity
GROUP BY owneridname, actualclosedate, statuscode) AS s ON s.owneridname = b.fullname RIGHT OUTER JOIN
(SELECT SUM(targetmoney) AS targetamt, goalowneridname, title
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')
GROUP BY goalowneridname, title) AS ss ON s.owneridname = ss.goalowneridname) AS n
WHERE (fullname IS NOT NULL)
performance of employee
SELECT s.actualvalue / 100000 AS actualvalue, s.actualclosedate, s.new_productsubcategoryname, s.owneridname, ss.targetmoney / 100000 AS targetmoney,
ss.goalowneridname, ss.title
FROM (SELECT actualvalue, actualclosedate, new_productsubcategoryname, owneridname
FROM FilteredOpportunity) AS s RIGHT OUTER JOIN
(SELECT targetmoney, goalowneridname, title
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')) AS ss ON s.new_productsubcategoryname = ss.title AND s.owneridname = ss.goalowneridname
employee performance on product:
SELECT owneridname, new_productsubcategoryname, estimatedclosedate, estimatedvalue / 100000 AS estimatedvalue, customeridname
FROM FilteredOpportunity
employee performance on region wise
SELECT s.actualamt / 100000 AS actualamt, s.owneridname, s.actualclosedate, s.statuscode, ss.targetamt / 100000 AS targetamt, ss.goalowneridname, b.fullname,
b.businessunitidname
FROM (SELECT fullname, businessunitidname
FROM FilteredSystemUser) AS b LEFT OUTER JOIN
(SELECT SUM(actualvalue) AS actualamt, owneridname, actualclosedate, statuscode
FROM FilteredOpportunity
GROUP BY owneridname, actualclosedate, statuscode) AS s ON s.owneridname = b.fullname RIGHT OUTER JOIN
(SELECT SUM(targetmoney) AS targetamt, goalowneridname
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')
GROUP BY goalowneridname) AS ss ON s.owneridname = ss.goalowneridname
product on region wise:
SELECT actualamt / 100000 AS actualamt, owneridname, actualclosedate, statuscode, targetamt / 100000 AS targetamt, goalowneridname, title, fullname,
businessunitidname
FROM (SELECT s.actualamt, s.owneridname, s.actualclosedate, s.statuscode, ss.targetamt, ss.goalowneridname, ss.title, b.fullname, b.businessunitidname
FROM (SELECT fullname, businessunitidname
FROM FilteredSystemUser
WHERE (fullname IS NOT NULL)) AS b LEFT OUTER JOIN
(SELECT SUM(actualvalue) AS actualamt, owneridname, actualclosedate, statuscode
FROM FilteredOpportunity
GROUP BY owneridname, actualclosedate, statuscode) AS s ON s.owneridname = b.fullname RIGHT OUTER JOIN
(SELECT SUM(targetmoney) AS targetamt, goalowneridname, title
FROM FilteredGoal
WHERE (title NOT LIKE 'Overall')
GROUP BY goalowneridname, title) AS ss ON s.owneridname = ss.goalowneridname) AS n
WHERE (fullname IS NOT NULL)