<?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 If..Then.. Renaming fields based off data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696443#M676804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done some searching and found many post about standard if/then and nested statements. What I could find and was wondering is if I could alias a field based on a different field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some code that I attempted in the script editor. I know its not right, but I think it get the point and idea of what I am trying to do across.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is something like this possible? If not, something close? Or do I need to load the data differently to accomplish what I am trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jun 2014 20:24:29 GMT</pubDate>
    <dc:creator>catalyst_75</dc:creator>
    <dc:date>2014-06-17T20:24:29Z</dc:date>
    <item>
      <title>If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696443#M676804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have done some searching and found many post about standard if/then and nested statements. What I could find and was wondering is if I could alias a field based on a different field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is some code that I attempted in the script editor. I know its not right, but I think it get the point and idea of what I am trying to do across.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is something like this possible? If not, something close? Or do I need to load the data differently to accomplish what I am trying to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 20:24:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696443#M676804</guid>
      <dc:creator>catalyst_75</dc:creator>
      <dc:date>2014-06-17T20:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696444#M676805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You seem to have forgotten to post your code!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 20:26:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696444#M676805</guid>
      <dc:creator />
      <dc:date>2014-06-17T20:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696445#M676807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for rename field (field, not values) you can search Rename Field in the online help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 20:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696445#M676807</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-06-17T20:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696446#M676809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, could have sworn it was there before hitting post. lol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(pat_carrier_type = 'I', pat_carrier_id AS [Conact ID], pat_carrier_id AS [Company ID]);&lt;/P&gt;&lt;P&gt;If(pat_payor_type = 'I', pat_payor_id AS [Conact ID], pat_payor_id AS [Company ID]);&lt;/P&gt;&lt;P&gt;If(pat_tpa_type = 'I', pat_tpa_id AS [Conact ID], pat_tpa_id AS [Company ID]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 23:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696446#M676809</guid>
      <dc:creator>catalyst_75</dc:creator>
      <dc:date>2014-06-17T23:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696447#M676812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cory,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this will not work. But what would work if you use a variable for the alias or, do a concatenate load where you have different fields depending on the selected data set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;pat_carrier_id AS [Conact ID],&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;From ...&lt;/P&gt;&lt;P&gt;Where pat_carrier_type = 'I';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate LOAD&lt;/P&gt;&lt;P&gt;pat_carrier_id AS [Company ID],&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;From ...&lt;/P&gt;&lt;P&gt;Where pat_carrier_type &amp;lt;&amp;gt; 'I';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But think this needs to be a litle bit more elaborated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 23:42:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696447#M676812</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-17T23:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696448#M676813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="example.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/60775_example.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 23:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696448#M676813</guid>
      <dc:creator />
      <dc:date>2014-06-17T23:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696449#M676815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good approach although the second expression should be all &amp;lt;&amp;gt;"I".&lt;/P&gt;&lt;P&gt;But what if a combination of fields is true/false (='I' or &amp;lt;&amp;gt;"I")..?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jun 2014 23:57:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696449#M676815</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-17T23:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696450#M676816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ralf. Can you clarify why the second expression should be &amp;lt;&amp;gt; 'I' rather than = 'I'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 01:57:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696450#M676816</guid>
      <dc:creator />
      <dc:date>2014-06-18T01:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696451#M676817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..for the else parts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(pat_carrier_type = 'I', pat_carrier_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(pat_payor_type = 'I', pat_payor_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(pat_tpa_type = 'I', pat_tpa_id)))&lt;/P&gt;&lt;P&gt;AS [Conact ID],&lt;/P&gt;&lt;P&gt;if(pat_carrier_type &amp;lt;&amp;gt; 'I', pat_carrier_id,&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(pat_payor_type &amp;lt;&amp;gt; 'I', pat_payor_id&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(pat_tpa_type &amp;lt;&amp;gt; 'I', pat_tpa_id)))&lt;/P&gt;&lt;P&gt;AS [Company ID]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 08:20:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696451#M676817</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2014-06-18T08:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: If..Then.. Renaming fields based off data</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696452#M676819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For nested if you should try this once&lt;/P&gt;&lt;P&gt;if(pat_carrier_type = 'I',pat_carrier_id,If(pat_payor_type = 'I',pat_payor_id,If(pat_tpa_type = 'I',pat_tpa_id))) &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;AS [Company ID])&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 08:28:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-Renaming-fields-based-off-data/m-p/696452#M676819</guid>
      <dc:creator />
      <dc:date>2014-06-18T08:28:00Z</dc:date>
    </item>
  </channel>
</rss>

