<?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: Concatenate String Variables to create Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875604#M305779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your answer got me almost there, the final solution just eliminates the quotes&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=$(vExpression_a)$(='-6m')$(vExpression_b)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 May 2015 02:43:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-05-18T02:43:32Z</dc:date>
    <item>
      <title>Concatenate String Variables to create Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875602#M305777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a project where I need 48 variations of an expression, so i'm trying to find a way to use variables as much as possible.&lt;/P&gt;&lt;P&gt;The chart will display average orders placed per person in 6 time increments (30/60/90 days/6 mth/12mth) before and after a point in time based on user selection via button that sets 4 variables (in blue below).&amp;nbsp; The final expression looks something like this:&lt;/P&gt;&lt;P&gt;Count(DISTINCT {&amp;lt;&lt;SPAN style="color: #3366ff;"&gt;OccurrenceFlagField&lt;/SPAN&gt; = {'&lt;SPAN style="color: #3366ff;"&gt;CriteriaPrefix&lt;/SPAN&gt;&lt;STRONG style="color: #00ff00;"&gt;TimeIncrement'&lt;/STRONG&gt;}&amp;gt;} ORDER_ID) / Count(DISTINCT &lt;SPAN style="font-size: 13.3333330154419px;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;PersonFlagField&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; = {&lt;SPAN style="color: #3366ff;"&gt;Person&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;}&amp;gt;} PERSON_ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For each possible event &lt;SPAN style="font-size: 13.3333330154419px;"&gt;(registration date, first online order date, first any coupon use date, first specific coupon use date),&lt;/SPAN&gt; I have buttons that set variables corresponding to the text in blue above:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;OccurrenceFlagField - &lt;SPAN style="color: #333333;"&gt;a field on the orders table &lt;SPAN style="font-size: 13.3333330154419px;"&gt;for each event &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;that contains a value indicating whether the order falls into one of the 12 date ranges for the consumer (ie. 'RegDt-30~FirstOnl+6m' indicates the order was placed within 30 days before registration date and within 6 months after first online order was placed)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-size: 13.3333330154419px;"&gt;CriteriaPrefix - &lt;SPAN style="color: #333333;"&gt;The string value in the flag field that corresponds to the selected event (i.e. 'RegDt' or 'FirstOnl')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-size: 13.3333330154419px;"&gt;&lt;SPAN style="color: #333333;"&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;PersonFlagField&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;- &lt;SPAN style="color: #333333;"&gt;the field which indicates the person qualifies to be counted in the expression (i.e. RegisteredFlg or OnlineOrderCount)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff; font-size: 13.3333330154419px;"&gt;Person&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;Criteria - &lt;SPAN style="color: #333333;"&gt;indication criteria for the set analysis (i.e. '1', '&amp;gt;0')&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the above expression in a variable that concatenates all the text strings together with the 4 variables and it works, with &lt;STRONG style="color: #00ff00; font-size: 13.3333330154419px;"&gt;TimeIncrement &lt;/STRONG&gt;hard-coded.&amp;nbsp; But for the sake of maintenance I'd rather not have 12 versions of the expression variable in my design (I WILL forget to update them all when changes are made).&amp;nbsp; I tried to break up the expression into parts before and after the time increment, and just hard code the time increment in the expression on the chart&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;, but it won't calculate that way, although when i hover over the expression header, the expression looks the same as it originally did when i had one variable with the time increment hard-coded.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;VariableA = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Count(DISTINCT {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #3366ff;"&gt;OccurrenceFlagField&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; = {'&lt;/SPAN&gt;&lt;SPAN style="color: #3366ff;"&gt;CriteriaPrefix&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #333333; font-size: 10pt;"&gt;VariableB = &lt;STRONG style="color: #00ff00; font-size: 13.3333330154419px;"&gt;'&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;}&amp;gt;} ORDER_ID) / Count(DISTINCT &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;{&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;PersonFlagField&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt; = {&lt;SPAN style="color: #3366ff;"&gt;Person&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; color: #3366ff;"&gt;Criteria&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;}&amp;gt;} PERSON_ID)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #333333; font-size: 13.3333330154419px;"&gt;Expression: =$(VariableA) &amp;amp; '-12m' &amp;amp; $(VariableB)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on a sample doc to better represent what I'm looking to do, and will attach it as soon as I can.&amp;nbsp; Any ideas are appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 00:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875602#M305777</guid>
      <dc:creator />
      <dc:date>2015-05-18T00:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate String Variables to create Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875603#M305778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a guess here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to expand the variables as text. The way to enforce that is to single quote the dollar expansion. There is no need to concatenate the expansion as such, just put all of them inside the same quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;='$(var1)$(var2)$(var3)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;An of course since you are creating field names and values, make sure there are no unfortunate blank spaces in the expanded result. For example the two expansions below will not be the same result&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;='$(var1)$(var2)$(var3)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;='$(var1) $(var2)$(var3)'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 00:59:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875603#M305778</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2015-05-18T00:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate String Variables to create Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875604#M305779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your answer got me almost there, the final solution just eliminates the quotes&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=$(vExpression_a)$(='-6m')$(vExpression_b)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 02:43:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Concatenate-String-Variables-to-create-Expression/m-p/875604#M305779</guid>
      <dc:creator />
      <dc:date>2015-05-18T02:43:32Z</dc:date>
    </item>
  </channel>
</rss>

