<?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: dynamic bookmark interferes with getfieldselections in table expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1988754#M81714</link>
    <description>&lt;P&gt;Managed to find a workaround by myself, so far it seems to work. For other users who encounter this issue, what I did was that I defined a variable with =GetFieldSelections([DateDimension]) but with an if statement before, "trapping" the string that the default bookmark makes GetFieldSelections return, like this:&lt;BR /&gt;&lt;BR /&gt;if(Left(GetFieldSelections([DateDimension]),1,='=',today(),GetFieldSelections([DateDimension]).&lt;/P&gt;
&lt;P&gt;When the default bookmark is applied the first character of the GetFieldSelection([DateDimension]) is an '=' sign, hence the if statement.&lt;/P&gt;
&lt;P&gt;The today function can easily be replaced by another variable or any function that returns a proper value and not a text string.&lt;/P&gt;
&lt;P&gt;Maybe not the most beautiful solution, but it seems to work in my case.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2022 15:40:24 GMT</pubDate>
    <dc:creator>gus12</dc:creator>
    <dc:date>2022-10-04T15:40:24Z</dc:date>
    <item>
      <title>dynamic bookmark interferes with getfieldselections in table expression</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1885610#M72945</link>
      <description>&lt;P&gt;QLIK SENSE ONLY Please.&lt;/P&gt;
&lt;P&gt;Bear with me, I swear this is a bookmark question.&amp;nbsp; I'm not trying to be confusing - I had a process that worked UNTIL the bookmark was applied.&amp;nbsp; Then my set analysis stopped working because the bookmark changed my result variable.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Set Analysis for YTD:&amp;nbsp; I have a set analysis that goes like this:&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt;&lt;BR /&gt;MONTHLY_DATE={"&amp;gt;=$(vCurrentDateSelectionFYStart) &amp;lt;=$(vMaxCurrentDateSelection)"},&lt;BR /&gt;MAIN_FLAG={'1'},&lt;BR /&gt;ACCOUNT_TYPE={'P &amp;amp; L'},&lt;BR /&gt;LEVEL_4={'TOTAL OPERATING EXPENSES'},&lt;BR /&gt;MONTHLY_TRANSACTION_TYPE_GROUP-={'B','F'}&lt;BR /&gt;&amp;gt;}MONTHLY_AMOUNT)&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Variable used in Set Analysis:&amp;nbsp; The variable&amp;nbsp;vCurrentDateSelectionFYStart is based on a field called MONTH_YEAR it's written like this:&lt;/P&gt;
&lt;P&gt;LET vCurrentDateSelectionFYStart = '= if(GetSelectedCount([&lt;STRONG&gt;MONTH_YEAR&lt;/STRONG&gt;])=1,NUM(MAKEDATE(IF(MONTH(Date#(GetFieldSelections([&lt;STRONG&gt;MONTH_YEAR&lt;/STRONG&gt;]),''MMM-YYYY'')) &amp;gt;= 7, YEAR(Date#(GetFieldSelections([&lt;STRONG&gt;MONTH_YEAR&lt;/STRONG&gt;]),''MMM-YYYY'')), &lt;BR /&gt;YEAR(Date#(GetFieldSelections([&lt;STRONG&gt;MONTH_YEAR&lt;/STRONG&gt;]),''MMM-YYYY'')) - 1), 07, 01)))';&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;And it works fine.&amp;nbsp; I highlighted the field above that's changing after the bookmark is applied.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; Bookmark Applied:&amp;nbsp; Then the user wanted to default the MONTH_YEAR to start as the last finished month (so for Jan 26,2022) it would be Dec-2021.&amp;nbsp; Pretty straight forward:&amp;nbsp; I applied a bookmark to the MONTH_YEAR field&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{&amp;lt;MONTH_YEAR={"=MONTH_YEAR=MONTH($(var_1MonthAgo))&amp;amp;'-'&amp;amp;YEAR(var_1MonthAgo)"}&amp;gt;}&lt;/P&gt;
&lt;P&gt;4.&amp;nbsp; BookMark causing issue with the set analysis variable:&amp;nbsp; Now the set analysis will not work because the&amp;nbsp;MONTH_YEAR, piece of my variable is coming through as&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;=MONTH_YEAR=MONTH($(var_1MonthAgo))&amp;amp;'-'&amp;amp;YEAR(var_1MonthAgo)&lt;/STRONG&gt;&amp;nbsp;appears everywhere above where the MONTH_YEAR was bolded.&lt;/P&gt;
&lt;P&gt;Can I do the default bookmark in a way that doesn't impact the set analysis (variable)?&lt;/P&gt;
&lt;P&gt;Thanks guys, I'm stumped right now!&lt;/P&gt;
&lt;P&gt;#Qlik Sense&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 15:20:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1885610#M72945</guid>
      <dc:creator>Crichter141</dc:creator>
      <dc:date>2022-01-26T15:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic bookmark interferes with getfieldselections in table expression</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1988670#M81708</link>
      <description>&lt;P&gt;Hey! I am facing the exact same issue. Did you come up with a solution on your own?&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;Gus&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 14:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1988670#M81708</guid>
      <dc:creator>gus12</dc:creator>
      <dc:date>2022-10-04T14:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic bookmark interferes with getfieldselections in table expression</title>
      <link>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1988754#M81714</link>
      <description>&lt;P&gt;Managed to find a workaround by myself, so far it seems to work. For other users who encounter this issue, what I did was that I defined a variable with =GetFieldSelections([DateDimension]) but with an if statement before, "trapping" the string that the default bookmark makes GetFieldSelections return, like this:&lt;BR /&gt;&lt;BR /&gt;if(Left(GetFieldSelections([DateDimension]),1,='=',today(),GetFieldSelections([DateDimension]).&lt;/P&gt;
&lt;P&gt;When the default bookmark is applied the first character of the GetFieldSelection([DateDimension]) is an '=' sign, hence the if statement.&lt;/P&gt;
&lt;P&gt;The today function can easily be replaced by another variable or any function that returns a proper value and not a text string.&lt;/P&gt;
&lt;P&gt;Maybe not the most beautiful solution, but it seems to work in my case.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2022 15:40:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/dynamic-bookmark-interferes-with-getfieldselections-in-table/m-p/1988754#M81714</guid>
      <dc:creator>gus12</dc:creator>
      <dc:date>2022-10-04T15:40:24Z</dc:date>
    </item>
  </channel>
</rss>

