<?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 Using GetFieldSelections in Dynamic Replace Function in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-GetFieldSelections-in-Dynamic-Replace-Function/m-p/1312149#M28058</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;I currently use a replace function in Qlik Sense to allow users to select KPIs from a List Box from dynamic expressions in my load script.&amp;nbsp; EventType is common in all of my formulas so I use a replace function to add in different time flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style=": ; color: #008000;"&gt;$(=replace(only({1&amp;lt;FormulaOrder={"$(=min(FormulaOrder))"}&amp;gt;} Formula), 'EventType', 'CurrentYearToDate = {1}, EventType'))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've recently added the date range picker extension and want to leverage the user selection range for current and prior year calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking I may be able to leverage the GetFieldSelections and a replace function to get what I need.&amp;nbsp; On top of that I would need to add it into the existing replace function I already use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking I could combine the above with this type of replacement but I'm not even close to getting it to work.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;replace((GetFieldSelections(CalendarDate)),'Year(Today())','Year(Today())-1')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End goal would look something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #008000;"&gt;$(=replace(only({1&amp;lt;FormulaOrder={"$(=min(FormulaOrder))"}&amp;gt;} Formula), 'EventType', '&lt;SPAN style="color: #800000;"&gt;CalendarDate&lt;/SPAN&gt; =&lt;STRONG style="color: #800000; font-size: 13.3333px;"&gt;replace((GetFieldSelections(CalendarDate)),[Year(Today())],'Year[Today())-1])&lt;/STRONG&gt;, EventType'))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #008000;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2017 14:06:00 GMT</pubDate>
    <dc:creator>RenewalBIUser</dc:creator>
    <dc:date>2017-07-14T14:06:00Z</dc:date>
    <item>
      <title>Using GetFieldSelections in Dynamic Replace Function</title>
      <link>https://community.qlik.com/t5/App-Development/Using-GetFieldSelections-in-Dynamic-Replace-Function/m-p/1312149#M28058</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;I currently use a replace function in Qlik Sense to allow users to select KPIs from a List Box from dynamic expressions in my load script.&amp;nbsp; EventType is common in all of my formulas so I use a replace function to add in different time flags.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style=": ; color: #008000;"&gt;$(=replace(only({1&amp;lt;FormulaOrder={"$(=min(FormulaOrder))"}&amp;gt;} Formula), 'EventType', 'CurrentYearToDate = {1}, EventType'))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've recently added the date range picker extension and want to leverage the user selection range for current and prior year calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking I may be able to leverage the GetFieldSelections and a replace function to get what I need.&amp;nbsp; On top of that I would need to add it into the existing replace function I already use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking I could combine the above with this type of replacement but I'm not even close to getting it to work.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;STRONG&gt;replace((GetFieldSelections(CalendarDate)),'Year(Today())','Year(Today())-1')&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End goal would look something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #008000;"&gt;$(=replace(only({1&amp;lt;FormulaOrder={"$(=min(FormulaOrder))"}&amp;gt;} Formula), 'EventType', '&lt;SPAN style="color: #800000;"&gt;CalendarDate&lt;/SPAN&gt; =&lt;STRONG style="color: #800000; font-size: 13.3333px;"&gt;replace((GetFieldSelections(CalendarDate)),[Year(Today())],'Year[Today())-1])&lt;/STRONG&gt;, EventType'))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG style="color: #008000;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #575757;"&gt;Thanks!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-GetFieldSelections-in-Dynamic-Replace-Function/m-p/1312149#M28058</guid>
      <dc:creator>RenewalBIUser</dc:creator>
      <dc:date>2017-07-14T14:06:00Z</dc:date>
    </item>
  </channel>
</rss>

