<?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: Any workaround for CrossTable hard string in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Any-workaround-for-CrossTable-hard-string/m-p/1701983#M725911</link>
    <description>&lt;P&gt;You can take a resident load of this to fix your field... for example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FxGbp:
CrossTable(Month, FxRate, 3) 
LOAD * 
FROM [$(vDirPath)\ManualInputs.xlsx] (ooxml, embedded labels, table is FxGbp);

FinalFxGbp:
LOAD *,
     Num(Num#(Month)) as Month1,
     Date(Date#(Month, 'YYYYMM'), 'YYYYMM') as Month2
Resident FxGbp;&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 14 May 2020 12:48:11 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2020-05-14T12:48:11Z</dc:date>
    <item>
      <title>Any workaround for CrossTable hard string</title>
      <link>https://community.qlik.com/t5/QlikView/Any-workaround-for-CrossTable-hard-string/m-p/1701968#M725910</link>
      <description>&lt;P&gt;From what I just experienced, it seems that the column headers that are being pivoted whilst calling CrossTable are cast to a "hard" string. What I mean by hard here is that the common duality of integer and string appears to be suspended. In the code below, this would be the case for Month (which looks like this: 202005)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;FxGbp:
CrossTable(Month, FxRate, 3) 
LOAD * 
FROM [$(vDirPath)\ManualInputs.xlsx] (ooxml, embedded labels, table is FxGbp)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I made some tests and things along the line of&lt;/P&gt;&lt;P&gt;NUM(Month, '#')&amp;nbsp; or&amp;nbsp;Month * 1&lt;/P&gt;&lt;P&gt;fail. On the other hand&lt;/P&gt;&lt;P&gt;Month &amp;amp; '_' works and returns 202005_&lt;/P&gt;&lt;P&gt;I have to join this data further down the&amp;nbsp; script with another field that under normal conditions is treated as an integer. It comes from SQL by the way, but it keeps being treated as integer also if I explicitly cast it as NVARCHAR, which I do either way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;LEFT(CAST(TxDateSerial AS NVARCHAR), 6) AS month_serial&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20200514 -&amp;gt; 202005&lt;/P&gt;&lt;P&gt;The only way I managed to have the join work thus far is by "forcing" the SQL field into a string by concatenating a '_' after the LEFT(), but I really don't like this kind of bodges.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have the CrossTable month treated as an integer/dual?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:38:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Any-workaround-for-CrossTable-hard-string/m-p/1701968#M725910</guid>
      <dc:creator>imark</dc:creator>
      <dc:date>2024-11-16T18:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Any workaround for CrossTable hard string</title>
      <link>https://community.qlik.com/t5/QlikView/Any-workaround-for-CrossTable-hard-string/m-p/1701983#M725911</link>
      <description>&lt;P&gt;You can take a resident load of this to fix your field... for example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FxGbp:
CrossTable(Month, FxRate, 3) 
LOAD * 
FROM [$(vDirPath)\ManualInputs.xlsx] (ooxml, embedded labels, table is FxGbp);

FinalFxGbp:
LOAD *,
     Num(Num#(Month)) as Month1,
     Date(Date#(Month, 'YYYYMM'), 'YYYYMM') as Month2
Resident FxGbp;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 May 2020 12:48:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Any-workaround-for-CrossTable-hard-string/m-p/1701983#M725911</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-05-14T12:48:11Z</dc:date>
    </item>
  </channel>
</rss>

