<?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: Select different fields depending on other field values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13077#M605099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Item, Date&lt;/P&gt;&lt;P&gt;1, StartDate&lt;/P&gt;&lt;P&gt;2, EndDate&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[Item, StartDate, EndDate&lt;/P&gt;&lt;P&gt; 1, 11/06/2018, 12/06/2018&lt;/P&gt;&lt;P&gt; 2, 09/06/2018, 10/06/2018&lt;/P&gt;&lt;P&gt; 1, 07/06/2018, 08/06/2018&lt;/P&gt;&lt;P&gt; 2, 06/06/2018, 07/06/2018&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalDate:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Peek(applymap('Fields', [Item], null()), RowNo() - 1, 'Data') as [Date]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capturar.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/204954_Capturar.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jun 2018 14:42:52 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-12T14:42:52Z</dc:date>
    <item>
      <title>Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13073#M605095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the script, for a field I would like to use the data from one field or another depending of the value of this field.&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;If the value inside the Item field is 1, I would like to use the column StartDate, and if the value inside the Item field is 2, I would like to use the data from EndDate column&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 160px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="21" width="80"&gt;Item&lt;/TD&gt;&lt;TD class="xl70" style="border-left: none;" width="80"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="text-align: center;"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-left: none; text-align: center;"&gt;StartDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="21" style="border-top: none; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none; text-align: center;"&gt;EndDate&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;P&gt;Obviously this should be automated and continue working in case of adding another item. I don't want to do this by adding the literal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 12:27:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13073#M605095</guid>
      <dc:creator>lanlizgu</dc:creator>
      <dc:date>2018-06-12T12:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13074#M605096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you can create a mappingtable/applymap for this and put the outcome between [] to use the outcome as field name. Not sure, so you will have to try and see if it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 12:39:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13074#M605096</guid>
      <dc:creator>bramkn</dc:creator>
      <dc:date>2018-06-12T12:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13075#M605097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not working an applymap here. I have created the following Applymap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XXXXXX:&lt;/P&gt;&lt;P&gt;Mapping LOAD &lt;/P&gt;&lt;P&gt;Item,&lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;FROM [xxxx.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is xxxx);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later the followinf line for the Applymap&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('&lt;SPAN style="font-size: 13.3333px;"&gt;XXXXXX&lt;/SPAN&gt;', [&lt;SPAN style="font-size: 13.3333px;"&gt;Item&lt;/SPAN&gt;], null()) as [&lt;SPAN style="font-size: 13.3333px;"&gt;Date&lt;/SPAN&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but what I get for Item 1 is the descriptor StartDate and not the value of the column StartDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 14:09:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13075#M605097</guid>
      <dc:creator>lanlizgu</dc:creator>
      <dc:date>2018-06-12T14:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13076#M605098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with and if it would be something like that&lt;/P&gt;&lt;P&gt;if(Item='1', StartDate, if(Item='2', EndDate)) as Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the thing is that I would like to have this in an automatic way and not add everytime there is a new Item a new line to the if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 14:18:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13076#M605098</guid>
      <dc:creator>lanlizgu</dc:creator>
      <dc:date>2018-06-12T14:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13077#M605099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Item, Date&lt;/P&gt;&lt;P&gt;1, StartDate&lt;/P&gt;&lt;P&gt;2, EndDate&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load * Inline&lt;/P&gt;&lt;P&gt;[Item, StartDate, EndDate&lt;/P&gt;&lt;P&gt; 1, 11/06/2018, 12/06/2018&lt;/P&gt;&lt;P&gt; 2, 09/06/2018, 10/06/2018&lt;/P&gt;&lt;P&gt; 1, 07/06/2018, 08/06/2018&lt;/P&gt;&lt;P&gt; 2, 06/06/2018, 07/06/2018&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FinalDate:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Peek(applymap('Fields', [Item], null()), RowNo() - 1, 'Data') as [Date]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capturar.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/204954_Capturar.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 14:42:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13077#M605099</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-12T14:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select different fields depending on other field values</title>
      <link>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13078#M605100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfectly working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much Daniel!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jun 2018 15:07:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-different-fields-depending-on-other-field-values/m-p/13078#M605100</guid>
      <dc:creator>lanlizgu</dc:creator>
      <dc:date>2018-06-12T15:07:18Z</dc:date>
    </item>
  </channel>
</rss>

