﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Marketing Tips and CRM Best Practices / Teradata   / Legends Report / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Wed, 03 Dec 2008 16:41:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Legends Report</title><link>http://www.teradata.com/teradataforum/Topic6840-6-1.aspx</link><description>Glad to help!  And, I'll thank our PS Consultant as well who provided the SQL.  I hope so far, you've found this message board to be helpful and if so, please spread the word!!  &lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;  &lt;br&gt;thanks, &lt;br&gt;Carol</description><pubDate>Tue, 13 Mar 2007 09:26:21 GMT</pubDate><dc:creator>Carol Barker</dc:creator></item><item><title>RE: Legends Report</title><link>http://www.teradata.com/teradataforum/Topic6840-6-1.aspx</link><description>The SQL that you provided is really neat. It is exactly what I was looking for. Thank you Carol!</description><pubDate>Tue, 13 Mar 2007 09:23:03 GMT</pubDate><dc:creator>kafrynrich</dc:creator></item><item><title>RE: Legends Report</title><link>http://www.teradata.com/teradataforum/Topic6840-6-1.aspx</link><description>Hello Kathryn,&lt;br&gt;Thanks for your post.  I have asked one of our senior PS consultants to help answer your question and they responded with the following. Please let me know if this works for you.  &lt;br&gt;thanks,&lt;br&gt;Carol&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;select &lt;br&gt;g.lgnd_grp_desc , &lt;br&gt;a.lgnd_desc , &lt;br&gt;max(case when g.lgnd_typ_Cd = 'S' then 'S' else '' end) as _Stand , &lt;br&gt;max(case when g.lgnd_typ_Cd = 'M' then 'M' else '' end) as _Filter , &lt;br&gt;max(case when g.lgnd_typ_Cd = 'L' then 'L' else '' end) as _link , &lt;br&gt;max(case when modify_effect_cd = 'D' THEN 'D' else '' end) _Display ,max(case when modify_effect_cd = 'R' THEN 'A' else '' end) _Attrib ,&lt;br&gt;max(case when a.fld_typ_cd = 'C' THEN 'C' else '' end) as _char , &lt;br&gt;max(case when a.fld_typ_cd = 'D' THEN 'D' else '' end) as _date ,max(case when a.fld_typ_cd = 'N' THEN 'N' else '' end) as _num ,&lt;br&gt;max(case WHEN a.cust_rollup_func = '*' then '*' else ''end) as _None , &lt;br&gt;max(case WHEN a.cust_rollup_func = 'sum' then 'S' else ''end) as _sum , &lt;br&gt;max(case WHEN a.cust_rollup_func = 'avg' then 'A' else '' end) as _avg ,max(case WHEN a.cust_rollup_func = 'count' then 'C' else '' end) as _cnt ,&lt;br&gt;max(case WHEN a.cust_rollup_func = 'min' then 'min' else '' end) as _min , &lt;br&gt;max(case WHEN a.cust_rollup_func = 'max' then 'max' else ''end) as _max, &lt;br&gt;max(case when a.rollup_typ_cd = 'A' then 'A' else '' end) as agg , &lt;br&gt;max(case when a.rollup_typ_cd = 'E' then 'E' else '' end) as _ever , &lt;br&gt;max(case when a.lgnd_fld_typ_cd = 'C' then 'C' else '' end) as _con, &lt;br&gt;max(case when a.lgnd_fld_typ_cd = 'E' then 'E' else '' end) as _enum , &lt;br&gt;max(case when a.lgnd_fld_typ_cd = 'M' then 'M' else '' end) as _mult , &lt;br&gt;max(case when b.freq_lev_cd = 'C' then 'C' else '' end) as _current , &lt;br&gt;max(case when b.freq_lev_cd = 'D' then 'D' else '' end) as _day , &lt;br&gt;max(case when b.freq_lev_cd = 'W' then 'W' else '' end) as _week , &lt;br&gt;max(case when b.freq_lev_cd = 'M' then 'M' else '' end) as _month , &lt;br&gt;max(case when b.freq_lev_cd = 'Q' then 'Q' else '' end) as _quarter , &lt;br&gt;max(case when b.freq_lev_cd = 'Y' then 'Y' else '' end) as _year , &lt;br&gt;max(case when b.cust_lev_cd = 'C' then 'C' else '' end) as _Client , &lt;br&gt;max(case when b.cust_lev_cd = 'A' then 'A' else '' end) as _account, &lt;br&gt;t.tbl_nm , &lt;br&gt;t.fld_nm, &lt;br&gt;count(*) &lt;br&gt;from ios_lgnd_mast a &lt;br&gt;left outer join ios_lgnd_det b &lt;br&gt;on a.div_id = b.div_id &lt;br&gt;and a.lgnd_mast_id = b.lgnd_mast_id &lt;br&gt;left outer join ios_lgnd_grps g &lt;br&gt;on a.div_id = g.div_id &lt;br&gt;and a.lgnd_grp_id = g.lgnd_grp_id &lt;br&gt;left outer join ios_lgnd_tbls t &lt;br&gt;on b.div_id = b.div_id &lt;br&gt;and b.lgnd_mast_id = t.lgnd_mast_id &lt;br&gt;and b.lgnd_det_id = t.lgnd_det_id &lt;br&gt;left outer join ios_lgnd_usr_dts u &lt;br&gt;on u.div_id = b.div_id &lt;br&gt;and u.lgnd_mast_id = t.lgnd_mast_id &lt;br&gt;and u.lgnd_det_id = t.lgnd_det_id &lt;br&gt;left outer join ios_lgnd_rngs r &lt;br&gt;on u.div_id = r.div_id &lt;br&gt;and u.lgnd_mast_id = r.lgnd_mast_id &lt;br&gt;and u.lgnd_det_id = r.lgnd_det_id &lt;br&gt;and u.lgnd_usr_dt_id = r.lgnd_usr_dt_id where a.div_id = 1 &lt;br&gt;group by &lt;br&gt;g.lgnd_grp_desc &lt;br&gt;,a.lgnd_desc &lt;br&gt;,a.lgnd_fld_typ_cd &lt;br&gt;,t.tbl_nm &lt;br&gt;,t.fld_nm &lt;br&gt;</description><pubDate>Tue, 13 Mar 2007 09:05:13 GMT</pubDate><dc:creator>Carol Barker</dc:creator></item><item><title>Legends Report</title><link>http://www.teradata.com/teradataforum/Topic6840-6-1.aspx</link><description>I have a manual report that was created to help show where the database fields are in the legends mapping. I have gotten behind on it since legends and columns are changed and added frequently. Does any one have SQL that they use for a report that is similar to this or do you have any suggestions on a better way to keep up with this report?&lt;br&gt;&lt;br&gt;Here are the columns that I use and a small sample (I had to pst it this way so that it would show correctly in the posting page):&lt;br&gt;&lt;br&gt;Columns:&lt;br&gt;Module&lt;br&gt;Tab&lt;br&gt;Table / View&lt;br&gt;TCRM Segmentation Selection&lt;br&gt;SQL Field added through TCRM&lt;br&gt;Category Definition&lt;br&gt;Time Interval&lt;br&gt;Field Reference for Time Interval&lt;br&gt;&lt;br&gt;Data Row 1:&lt;br&gt;Customer&lt;br&gt;Absolute&lt;br&gt;I0023B_ADR&lt;br&gt;State&lt;br&gt;ST_PVN_CD&lt;br&gt;Household&lt;br&gt;Current&lt;br&gt;NA&lt;br&gt;&lt;br&gt;Data Row 2:&lt;br&gt;Store Location&lt;br&gt;Region/District&lt;br&gt;i0050C_LCT&lt;br&gt;District&lt;br&gt;DIT_NBR&lt;br&gt;Store Activity&lt;br&gt;Year&lt;br&gt;CAL_DT&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Kathryn</description><pubDate>Mon, 12 Mar 2007 10:08:39 GMT</pubDate><dc:creator>kafrynrich</dc:creator></item></channel></rss>