<?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: Passing variable field name into GetFieldSelections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379891#M420800</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny - but I'm hoping to avoid the hardcoding of date1, date2 etc altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have these values in the straight table (in the DateField field), I thought it should be possible to pass this value into the function, so all I need to maintain is my INLINE list of fields and descriptions on the load script - i.e. like &lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Aug 2017 09:54:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-08-11T09:54:46Z</dc:date>
    <item>
      <title>Passing variable field name into GetFieldSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379889#M420798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a custom Current Selections box for a particular set of date fields using a straight table and an expression that uses GetFieldSelections to return the values currently selected for each field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my load script I'm creating an inline table of fields that I want to show in this table, i.e.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;DateFilters:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt;DateField, DateDescription&lt;BR /&gt; date1, Creation Date&lt;BR /&gt; date2, Closed Date&lt;BR /&gt; date3, Target Due Date&lt;BR /&gt; date4, Last Saved Date &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far I've managed to achieve the example straight table shown below using the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Dimensions:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DateField&lt;/STRONG&gt; (hidden)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Expressions:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date Field:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateDescription&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current Filter:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Replace&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)='date1',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;date1&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)='date2',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;date2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)='date3',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;date3&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;),&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)='date4',&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;date4&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;))))),'&amp;gt;=',''),'&amp;lt;=',' - ') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/173064_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to avoid the nested IFs as I look to expand this elsewhere, and want to use the value in the DateField field inside the GetFieldSelections instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to achieve this using the following formula but get the error "Nested aggregation not allowed":&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Does anyone have any suggestions how I could use the field name stored in DateField inside the GetFieldSelections function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;(note - I'm using the only({1}) function since I want users to be able to click on each of the Date field rows and use this to apply date filters to each - so this ensures that all Date Fields are always shown in the table)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 12:09:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379889#M420798</guid>
      <dc:creator />
      <dc:date>2017-08-10T12:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable field name into GetFieldSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379890#M420799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try with Pick(Match(...))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pick(Match(Only({1}DateField), 'date1', 'date2', 'date3', 'date4'), GetFieldSelections(date1), GetFieldSelections(date2), GetFieldSelections(date3), GetFieldSelections(date4))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Aug 2017 17:21:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379890#M420799</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-10T17:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable field name into GetFieldSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379891#M420800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Sunny - but I'm hoping to avoid the hardcoding of date1, date2 etc altogether.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have these values in the straight table (in the DateField field), I thought it should be possible to pass this value into the function, so all I need to maintain is my INLINE list of fields and descriptions on the load script - i.e. like &lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;GetFieldSelections&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;only&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;({1}&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;DateField&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 09:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379891#M420800</guid>
      <dc:creator />
      <dc:date>2017-08-11T09:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable field name into GetFieldSelections</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379892#M420801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I don't think this would be possible&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Aug 2017 15:22:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-variable-field-name-into-GetFieldSelections/m-p/1379892#M420801</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-11T15:22:17Z</dc:date>
    </item>
  </channel>
</rss>

