<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting counts on dimensions from 2 tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Getting-counts-on-dimensions-from-2-tables/m-p/377766#M140825</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I resolved this by concatenating the lead and contact tables in the load script. I added an addtional field of [record type] to this combined table which I populated with either 'Lead' or 'Contact' so I am able to report on the breakdown if needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was an issue linking this to the campaign member table from Salesforce as it created a synthetic key on LeadId and ContactId. To get around this I created a field called LeadContactId using the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(len(ContactId)=0, LeadId,ContactId) as LeadContactId&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And put my LeadId and ContactId into a field of the same name in my concatenated table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solution works for us as all of our shared lead and contact fields are standardised in the same way. It also makes it much easier to report campaigns where they can be a combination of leads and contacts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just thought I'd share this solution in case anyone else encounters a similar problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2012 11:40:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-08-15T11:40:08Z</dc:date>
    <item>
      <title>Getting counts on dimensions from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-counts-on-dimensions-from-2-tables/m-p/377765#M140824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get counts by a dimension from 2 tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 226px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl68" colspan="2" height="17" style="text-align: center;" width="226"&gt;&lt;STRONG&gt;Table: Leads&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" style="border-top: none;"&gt;Lead_Created_Date&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;LeadId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;L1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;L2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;L3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;L4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;L5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 226px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl68" colspan="2" height="17" style="text-align: center;" width="226"&gt;&lt;STRONG&gt;Table: Contacts&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" style="border-top: none;"&gt;Contact_Created_Date&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;ContactId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;C1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;C2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;C3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;C4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;DD/MM/YYYY&lt;/TD&gt;&lt;TD align="right" class="xl66" style="border-top: none; border-left: none;"&gt;C5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to a chart to display total leads + total contacts by created date. I have tried combining the created_date fields by using a calculated dimension of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=if(isnull(monthname(ContactCreatedDate)), monthname(LeadCreatedDate), monthname(ContactCreatedDate))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And an expression of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;=Count (distinct ContactId) + Count (DISTINCT LeadId)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I drill down into the report it only gives me counts of where both a LeadId and a ContactId exists (converted leads). Any ideas on how I can combine these dimensions from 2 tables would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 16:14:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-counts-on-dimensions-from-2-tables/m-p/377765#M140824</guid>
      <dc:creator />
      <dc:date>2012-08-14T16:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting counts on dimensions from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/Getting-counts-on-dimensions-from-2-tables/m-p/377766#M140825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I resolved this by concatenating the lead and contact tables in the load script. I added an addtional field of [record type] to this combined table which I populated with either 'Lead' or 'Contact' so I am able to report on the breakdown if needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was an issue linking this to the campaign member table from Salesforce as it created a synthetic key on LeadId and ContactId. To get around this I created a field called LeadContactId using the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(len(ContactId)=0, LeadId,ContactId) as LeadContactId&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And put my LeadId and ContactId into a field of the same name in my concatenated table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This solution works for us as all of our shared lead and contact fields are standardised in the same way. It also makes it much easier to report campaigns where they can be a combination of leads and contacts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just thought I'd share this solution in case anyone else encounters a similar problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 11:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Getting-counts-on-dimensions-from-2-tables/m-p/377766#M140825</guid>
      <dc:creator />
      <dc:date>2012-08-15T11:40:08Z</dc:date>
    </item>
  </channel>
</rss>

