<?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 Dynamic variable name in pivot table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-variable-name-in-pivot-table/m-p/20127#M771689</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 have a pivot table that show the margins per product line and sales representative. However, for the forecast I would like to have something dynamic where during my presentation the sales representative could say which margin or volume he is going to do and I could change a variable specific for the key combination of Representative&amp;amp;ProductLine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to do that, I have created through a loop, hundreds of variables that - when changed - will replace the margin loaded in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea was to have a 'real time' replacement of the data in the database based on these variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problem to create all these variables was solved but the problem now was to use it in a pivot table - and how to apply it in a way that when I filter 3 salesrepresentative he will use the variables of all these three representatives - again, like he have replaced the original column in the database with the data in the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, I have created a pivot first using Representative&amp;amp;'_'&amp;amp;ProductLine as key, and the result was the one that I was expecting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 287px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="3" height="20" width="287"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2_B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3_C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4_D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5_E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to use =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine')) the column comes blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 322px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20" width="322"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20"&gt;Variable2 =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine'))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2_B&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3_C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;4_D&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;5_E&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when &lt;STRONG&gt;I filter a specific representative and productline&lt;/STRONG&gt;, then the column is populated accordingly to the variable created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 322px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20" width="322"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20"&gt;Variable2 =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine'))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;STRONG&gt;2000&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not a set analysis issue since I have already tried using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, I kindly request your knowledge to help me through it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Dynamic variable name in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-variable-name-in-pivot-table/m-p/20127#M771689</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 have a pivot table that show the margins per product line and sales representative. However, for the forecast I would like to have something dynamic where during my presentation the sales representative could say which margin or volume he is going to do and I could change a variable specific for the key combination of Representative&amp;amp;ProductLine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to do that, I have created through a loop, hundreds of variables that - when changed - will replace the margin loaded in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea was to have a 'real time' replacement of the data in the database based on these variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the problem to create all these variables was solved but the problem now was to use it in a pivot table - and how to apply it in a way that when I filter 3 salesrepresentative he will use the variables of all these three representatives - again, like he have replaced the original column in the database with the data in the variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, I have created a pivot first using Representative&amp;amp;'_'&amp;amp;ProductLine as key, and the result was the one that I was expecting:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 287px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" colspan="3" height="20" width="287"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2_B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;C&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3_C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4_D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;5_E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when I try to use =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine')) the column comes blank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 322px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20" width="322"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20"&gt;Variable2 =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine'))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;B&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;2_B&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;3_C&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;4&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;4_D&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;5_E&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;-&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when &lt;STRONG&gt;I filter a specific representative and productline&lt;/STRONG&gt;, then the column is populated accordingly to the variable created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 322px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20" width="322"&gt;Variable = Representative&amp;amp;'_'&amp;amp;ProductLine&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" colspan="4" height="20"&gt;Variable2 =$(=('Representative&amp;amp;'_'&amp;amp;ProductLine'))&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;Representative&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;ProductLine&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;Variable&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;"&gt;&lt;STRONG&gt;Variable 2&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" style="border-top: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;A&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;1_A&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;STRONG&gt;2000&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not a set analysis issue since I have already tried using it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, I kindly request your knowledge to help me through it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-variable-name-in-pivot-table/m-p/20127#M771689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic variable name in pivot table</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-variable-name-in-pivot-table/m-p/20128#M771690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubt that you get this approach ever to work. Calculations within a $-sign expansion are global and not related to the dimensions of your object - and in this global context you would also need aggregations for the included fields because without they return NULL if a field had more than one possible value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternatively for your case might be Inputfields (&lt;A href="https://community.qlik.com/docs/DOC-8302"&gt;Insert a string value to multiple InputField rows&lt;/A&gt;) or probably even better the use of any WriteBack approach to a database like &lt;A href="https://community.qlik.com/docs/DOC-5970"&gt;SQL Writeback from QlikView extension object.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing of them is easy to implement and therefore it might be considerable to buy such a solution. AFAIK there are multiple partners which offer such tools.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2018 09:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-variable-name-in-pivot-table/m-p/20128#M771690</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-05-29T09:20:53Z</dc:date>
    </item>
  </channel>
</rss>

