<?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: Model doesn't link correcty in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439413#M806165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem Juan, glad to help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Oct 2017 15:21:29 GMT</pubDate>
    <dc:creator>felipedl</dc:creator>
    <dc:date>2017-10-26T15:21:29Z</dc:date>
    <item>
      <title>Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439408#M806160</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 have the next model:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="model.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/181015_model.png" style="height: 406px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to take this:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count(id_ruta) by pais_aeropuerto.&lt;/P&gt;&lt;P&gt;Dimension = pais_aeropuerto&lt;/P&gt;&lt;P&gt;Expresion = count(id_ruta)&lt;/P&gt;&lt;P&gt;The link is: pais_aeropuerto (airports) -&amp;gt; id_aeropuerto_ori(routes) -&amp;gt; id_ruta(routes)&lt;/P&gt;&lt;P&gt;but it doesn't work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="analisis1.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/181019_analisis1.png" style="height: 355px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I connect directly:&amp;nbsp; id_aeropuerto_ori(routes) -&amp;gt; id_ruta(routes). It works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="analisis2.png" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/181020_analisis2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439408#M806160</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439409#M806161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since your airports table has both id_aeropuerto_ori and &lt;SPAN style="font-size: 13.3333px;"&gt;id_aeropuerto_dest, it's creating a synthetic link with the routes table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Don't know aobut your data, but my guess is that the airports table doesn't have the id_aeropuerto_des and can't create the link in both tables with this synthetic key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;So, when you connect directly to the id_eropuerto_ori works because it has a direct link for only one existing field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;How did you create both (ori and des) fields in the airports table by the way?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Other thing is, why do you have this kind of information on the airports side? To me, this kind of model doesn't make much sense since the airports table is a dimension and your routes table is your fact.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Instead of creating both IDs, use some type of key to remove the synthetic key.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;See this community post for some help:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;A __default_attr="3451" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://community.qlik.com/"&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Felipe.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:21:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439409#M806161</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-26T13:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439410#M806162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes airports is a dimension table of hc_routes and connect via tu fields;&lt;/P&gt;&lt;P&gt;id_airport_ori and id_airport_des, this fileds are in hc_routes but not&lt;/P&gt;&lt;P&gt;in dm_airports then I had to create it in dm_airports in order to make the links.&lt;/P&gt;&lt;P&gt;You can see in the scripts below&lt;/P&gt;&lt;P&gt;How can I manage this kind of relationship (role-playing dimensions)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD id_aeropuerto as id_aeropuerto_ori, id_aeropuerto as id_aeropuerto_des, *; /* añadimos ori y des para cruces */&lt;/P&gt;&lt;P&gt;LOAD @1 as id_aeropuerto, @2 as nombre_aeropuerto, @3 as ciudad_aeropuerto, @4 as pais_aeropuerto, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 as cod_iata_aeropuerto, @6 as cod_icao_aeropuerto, @7 as latitud, @8 as longitud, @9 as altitud&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as id_aerolinea, @2 as nombre_aerolinea, @3 as alias_aerolinea, @4 as cod_iata_aerolinea, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 as cod_icao_aerolinea, @6 as identificador, @7 as pais_aerolinea, @8 as sw_activa&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD RowNo() as id_ruta, *; /* anadimos id_ruta */&lt;/P&gt;&lt;P&gt;LOAD @1 as cod_aerolinea, @2 as id_aerolinea, @3 as cod_aeropuerto_ori, @4 as id_aeropuerto_ori, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 as cod_aeropuerto_des, @6 as id_aeropuerto_des, @7 as codeshare, @8 as paradas, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @9 as equipamientos&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt;&lt;/C&gt;&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:31:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439410#M806162</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T13:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439411#M806163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Juan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way you want it, I can't see a simpler way then having two separate tables, one for origin and destination if you really need the data for the destination airport.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will basically be a copy of the same table as origin airport, but with the separation of ids for origin and destination.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Other solution would be to create a generic key for each origin / destination aiport combination, but that would create so many new lines in your table, since I believe there would be a lot more combinations than simply duplicating the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached the code I believe is best.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 13:52:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439411#M806163</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-26T13:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439412#M806164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Felip,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:57:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439412#M806164</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-26T14:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Model doesn't link correcty</title>
      <link>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439413#M806165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No problem Juan, glad to help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Oct 2017 15:21:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Model-doesn-t-link-correcty/m-p/1439413#M806165</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2017-10-26T15:21:29Z</dc:date>
    </item>
  </channel>
</rss>

