The table is called Synonyms, you join the field you want to convert to the VALUE field in this table and then use the ITEM_NAME field to display.
This example uses the Synonyms tables to extract the Skill name and Agent name from the daily Agent stats table. The Synonyms table has to be joined twice in this example to extract the 2 different types of names (aliased here as "a" for agent name and "s" for skill name).
SELECT ACD,
ROW_DATE,
LOGID,
a.item_name As LoginName,
SPLIT,
s.item_name As SplitSkill,
Sum(ACDCALLS) As SumACDCalls,
Sum(ACDTIME) As SumACDTime
FROM dagent, synonyms s, synonyms a
WHERE dagent.SPLIT=s.value AND
dagent.ACD=s.ACD_NO AND
s.item_type='split' AND
dagent.LOGID=a.value AND
dagent.ACD=a.ACD_NO AND
a.item_type='agname' AND
dagent.ACD=3 AND
ROW_DATE=(TODAY - 1 UNITS DAY)
GROUP BY ACD,ROW_DATE,LOGID,
a.item_name,SPLIT, s.item_name
The join is made using the ACD field (for multi-ACD environments), the ITEM_TYPE field and then the VALUE field. Useful values for ITEM_TYPE are:
acd, agname, split,
vdn, vector, aux_rsn,
logout_rsn
|