<?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: Treat null values coming from an automatic join of two tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817038#M66885</link>
    <description>&lt;P&gt;Could you extract the data from the individual tables into Excel files so that I can take a look?&amp;nbsp; Alter any confidential data before attaching it.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Jun 2021 15:05:24 GMT</pubDate>
    <dc:creator>rbartley</dc:creator>
    <dc:date>2021-06-22T15:05:24Z</dc:date>
    <item>
      <title>Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816591#M66840</link>
      <description>&lt;P&gt;Hello.&lt;BR /&gt;I have two tables where qlik makes a join with the column 'Servidor'.&lt;/P&gt;&lt;P&gt;I want the resulting tuples to treat the null values as an empty string. But it's not working.&lt;/P&gt;&lt;P&gt;Here's my script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'anatelbdro01 - D-1 de produção';&lt;/P&gt;&lt;P&gt;NullAsValue *;&lt;/P&gt;&lt;P&gt;Set Nullvalue = '';&lt;/P&gt;&lt;P&gt;LOAD Servidor,&lt;BR /&gt;Início,&lt;BR /&gt;Fim,&lt;BR /&gt;Horas,&lt;BR /&gt;Curso;&lt;BR /&gt;[cursos]:&lt;BR /&gt;SQL SELECT NomeEmpregado as Servidor,&lt;BR /&gt;evento."DataIniRealizacao" as Início,&lt;BR /&gt;evento."DataFimRealizacao" as Fim,&lt;BR /&gt;evento."CargaHoraria" as Horas,&lt;BR /&gt;evento."descEvento" as Curso&lt;BR /&gt;FROM SARH.dbo.Empregado&lt;BR /&gt;LEFT JOIN SDTA.dbo."V_AuditoriaEventoServidor" as evento&lt;BR /&gt;ON evento.numCpf = Empregado.NumCpf&lt;BR /&gt;LEFT JOIN SARH.dbo.DadosFuncionais as dados&lt;BR /&gt;ON dados.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;JOIN SARH.dbo.Orgao as orgao&lt;BR /&gt;ON orgao.CodOrgao = dados.CodUltimaLotacao&lt;BR /&gt;AND orgao.SiglaOrgao LIKE 'GR08%'&lt;BR /&gt;WHERE dados.DataSaidaEmpregado is null&lt;/P&gt;&lt;P&gt;UNION&lt;/P&gt;&lt;P&gt;SELECT NomeEmpregado as Servidor2,&lt;BR /&gt;capacitacao."DataInicio" as Início2,&lt;BR /&gt;capacitacao."DataFim" as Fim2,&lt;BR /&gt;capacitacao."CargaHoraria" as Horas2,&lt;BR /&gt;capacitacao."descTitulo" as Curso2&lt;BR /&gt;FROM SARH.dbo.Empregado&lt;BR /&gt;LEFT JOIN SDTA.dbo."SHC_CapacitacaoNaoInstitucional" as capacitacao&lt;BR /&gt;ON capacitacao.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;LEFT JOIN SARH.dbo.DadosFuncionais as dados&lt;BR /&gt;ON dados.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;JOIN SARH.dbo.Orgao as orgao&lt;BR /&gt;ON orgao.CodOrgao = dados.CodUltimaLotacao&lt;BR /&gt;AND orgao.SiglaOrgao LIKE 'GR08%'&lt;BR /&gt;WHERE dados.DataSaidaEmpregado is null;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[cursos_sugeridos]:&lt;BR /&gt;LOAD&lt;BR /&gt;[Titulos],&lt;BR /&gt;[Servidor]&lt;BR /&gt;FROM [lib://AttachedFiles/Indicação de cursos_2.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Planilha2);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I'm using&amp;nbsp;NullAsValue but I still get the following:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="06.png" style="width: 873px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57176i6BA6AA2C85940963/image-size/large?v=v2&amp;amp;px=999" role="button" title="06.png" alt="06.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the same time that I also have:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="07.png" style="width: 869px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57179iE5C15F1AA7B78558/image-size/large?v=v2&amp;amp;px=999" role="button" title="07.png" alt="07.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With empty strings instead of null values.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Why is this happening? How can I fix this?&lt;BR /&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 18:17:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816591#M66840</guid>
      <dc:creator>lailarhc</dc:creator>
      <dc:date>2021-11-30T18:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816620#M66845</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A couple of points: 1) Why are you renaming the columns in your UNION select statement e.g .... as Servidor2?&amp;nbsp; If they are being unioned, then I assume they will use the field name in the first part of the UNION query, i.e. Servidor instead of Servidor2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) in the query for the table&amp;nbsp;&lt;SPAN&gt;[cursos_sugeridos] , you are doing a straight load, i.e. an equi-join, but I imagine you should be doing a left join, so you join all of the records in table 1 &lt;STRONG&gt;AND&lt;/STRONG&gt;&amp;nbsp;those that match in your Excel file, and for unmatched records, there will be no suggested courses.&amp;nbsp; I don't think your NullAsValue function will work without the left join as the record will simply not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if I've misinterpreted something and, if so, it would be useful if you attached your qvf (app) file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 14:34:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816620#M66845</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2021-06-21T14:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816656#M66848</link>
      <description>&lt;P&gt;You're right about the renaming of the columns. I fixed that as there was no need for them to be named differently.&lt;BR /&gt;As for the left load, I actually need all the records in both tables. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;I need the records in excel file for another chart table, so I don't think I should use a Left join.&lt;BR /&gt;&lt;BR /&gt;And I'm using the cloud version, so I don't have a qvp file. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if there's anything else I can do to clarify my problem.&lt;BR /&gt;And thank you for answering. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 16:23:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1816656#M66848</guid>
      <dc:creator>lailarhc</dc:creator>
      <dc:date>2021-06-21T16:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817038#M66885</link>
      <description>&lt;P&gt;Could you extract the data from the individual tables into Excel files so that I can take a look?&amp;nbsp; Alter any confidential data before attaching it.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 15:05:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817038#M66885</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2021-06-22T15:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817286#M66927</link>
      <description>&lt;P&gt;Hello &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I managed to do what I wanted by doing an outer join with the tables.&lt;BR /&gt;Here's what my script looks like now:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;LIB CONNECT TO 'anatelbdro01 - D-1 de produção';&lt;/P&gt;&lt;P&gt;NullAsValue *;&lt;/P&gt;&lt;P&gt;Set Nullvalue = '';&lt;/P&gt;&lt;P&gt;LOAD Servidor,&lt;BR /&gt;Início,&lt;BR /&gt;Fim,&lt;BR /&gt;Horas,&lt;BR /&gt;Curso;&lt;BR /&gt;[cursos]:&lt;BR /&gt;SQL SELECT NomeEmpregado as Servidor,&lt;BR /&gt;evento."DataIniRealizacao" as Início,&lt;BR /&gt;evento."DataFimRealizacao" as Fim,&lt;BR /&gt;evento."CargaHoraria" as Horas,&lt;BR /&gt;evento."descEvento" as Curso&lt;BR /&gt;FROM SARH.dbo.Empregado&lt;BR /&gt;LEFT JOIN SDTA.dbo."V_AuditoriaEventoServidor" as evento&lt;BR /&gt;ON evento.numCpf = Empregado.NumCpf&lt;BR /&gt;LEFT JOIN SARH.dbo.DadosFuncionais as dados&lt;BR /&gt;ON dados.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;JOIN SARH.dbo.Orgao as orgao&lt;BR /&gt;ON orgao.CodOrgao = dados.CodUltimaLotacao&lt;BR /&gt;AND orgao.SiglaOrgao LIKE 'GR08%'&lt;BR /&gt;WHERE dados.DataSaidaEmpregado is null&lt;/P&gt;&lt;P&gt;UNION&lt;/P&gt;&lt;P&gt;SELECT NomeEmpregado as Servidor,&lt;BR /&gt;capacitacao."DataInicio" as Início,&lt;BR /&gt;capacitacao."DataFim" as Fim,&lt;BR /&gt;capacitacao."CargaHoraria" as Horas,&lt;BR /&gt;capacitacao."descTitulo" as Curso&lt;BR /&gt;FROM SARH.dbo.Empregado&lt;BR /&gt;LEFT JOIN SDTA.dbo."SHC_CapacitacaoNaoInstitucional" as capacitacao&lt;BR /&gt;ON capacitacao.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;LEFT JOIN SARH.dbo.DadosFuncionais as dados&lt;BR /&gt;ON dados.CodEmpregado = Empregado.CodEmpregado&lt;BR /&gt;JOIN SARH.dbo.Orgao as orgao&lt;BR /&gt;ON orgao.CodOrgao = dados.CodUltimaLotacao&lt;BR /&gt;AND orgao.SiglaOrgao LIKE 'GR08%'&lt;BR /&gt;WHERE dados.DataSaidaEmpregado is null;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;outer Join(cursos)&lt;BR /&gt;LOAD&lt;BR /&gt;[Titulos],&lt;BR /&gt;[Servidor]&lt;BR /&gt;FROM [lib://AttachedFiles/Indicação de cursos_2.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Planilha2);&lt;BR /&gt;&lt;BR /&gt;Now I have a single table where all the null values are replaced with an empty string.&lt;BR /&gt;I actually got the idea from your first comment, so thank you!&lt;BR /&gt;&lt;BR /&gt;I'll be closing this post and marking it as solved. ^^&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 11:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817286#M66927</guid>
      <dc:creator>lailarhc</dc:creator>
      <dc:date>2021-06-23T11:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Treat null values coming from an automatic join of two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817347#M66942</link>
      <description>&lt;P&gt;Ok.&amp;nbsp; Glad it helped.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 13:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Treat-null-values-coming-from-an-automatic-join-of-two-tables/m-p/1817347#M66942</guid>
      <dc:creator>rbartley</dc:creator>
      <dc:date>2021-06-23T13:00:24Z</dc:date>
    </item>
  </channel>
</rss>

