<?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: Variable in Class function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812653#M286817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure how you are calculating the Bucket... But can try to help you out..&lt;/P&gt;&lt;P&gt;I will provide you how to find out the Max Price and Min Price...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Max Price&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;gt; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Min Price&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;lt; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Max Price &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;- Min Price&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF(Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;gt; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;IF(Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;lt; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this would help !!&lt;/P&gt;&lt;P&gt;Otherwise, we can have another try with little more explanation from your end!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Mar 2015 20:06:27 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2015-03-30T20:06:27Z</dc:date>
    <item>
      <title>Variable in Class function</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812650#M286814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the Class function to generate bucket ranges dynamically and having trouble getting the buckets to generate when inserting variables into the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Here is the Class function:&amp;nbsp; =Class(&lt;STRONG&gt;&lt;EM&gt;x&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;,&lt;STRONG&gt; class_width&lt;/STRONG&gt;, &lt;STRONG&gt;format&lt;/STRONG&gt;&lt;/EM&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here is how I have tried to recreate it:&amp;nbsp; =Class($(vBucketRange), $(vBucketBin), ' $ ') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can x be replaced with a formula or variable?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DETAILS:&lt;/P&gt;&lt;P&gt;1. In my requirement, &lt;STRONG&gt;x&lt;/STRONG&gt; should be determined based on the larger value of two different fields . . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &lt;STRONG&gt; x&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;=if(Flag_A=1 and Flag_B=1 and (PriceField1 &amp;gt; max(PriceField2)), PriceField1,&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; if(Flag_A=1 and Flag_B=1 and (PriceField1 &amp;lt; max(PriceField2)), max(PriceField2))&lt;BR /&gt; &lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The class width should be the difference between the maximum value of two different fields and the minimum value of the same two different fields, divided by the number of bucket ranges selected by the user. . .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt; &lt;STRONG&gt; class_width = &lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;=(if(max(PriceField1) &amp;gt; max(PriceField2), max(PriceField1), max(PriceField2&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp; -&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if(min(PriceField1) &amp;lt; min(PriceField2), min(PriceField1), min(PriceField2))&lt;/P&gt;&lt;P style="padding-left: 60px;"&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; /&lt;BR /&gt;&amp;nbsp; vNumberOfBuckets&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created variables for the expressions above. Each variable renders the appropriate values when inserted into chart expressions. However, neither the variables nor the expressions seem to work within the Class function dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2015 03:31:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812650#M286814</guid>
      <dc:creator>ellenblackwell</dc:creator>
      <dc:date>2015-03-28T03:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in Class function</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812651#M286815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are using &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;max(PriceField1)... Try to use &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;max(TOTAL PriceField1) for both PriceField1 and PriceFiel2. If still not work, kindly provide sample data..&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Mar 2015 09:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812651#M286815</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-03-28T09:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in Class function</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812652#M286816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response. I cannot provide an example of the app, but I have outlined the type of data I am working with - and an explanation of what I am trying to accomplish - in the table below. Based on the requirement, I am not sure that the Total() function will work. Please let me know if this provides enough additional insight.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 824pt; border-collapse: collapse;" width="1096"&gt;&lt;TBODY&gt;&lt;TR style="height: 89.25pt;"&gt;&lt;TD class="xl72" height="119" style="border-width: 1pt 0.5pt 0.5pt; border-style: solid; border-color: gainsboro; width: 65pt; height: 89.25pt; background-color: whitesmoke;" width="86"&gt;&lt;STRONG style="color: #333333;"&gt;MyProduct&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl92" style="border-width: 1pt 0px 0.5pt; border-style: solid none; border-color: gainsboro #333333; width: 65pt; background-color: whitesmoke;" width="86"&gt;&lt;STRONG style="color: #333333;"&gt;Store&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl73" style="border-width: 1pt 1pt 0.5pt 0.5pt; border-style: solid; border-color: gainsboro; width: 101pt; background-color: whitesmoke;" width="134"&gt;&lt;STRONG style="color: #333333;"&gt;CompetitorProducts&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl74" style="border: 0.5pt solid gainsboro; width: 68pt; background-color: white;" width="91"&gt;&lt;SPAN style="color: #333333;"&gt;PriceField1 (for My product)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl74" style="border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: gainsboro gainsboro gainsboro #333333; width: 109pt; background-color: white;" width="145"&gt;&lt;SPAN style="color: #333333;"&gt;PriceField2 (for Comp products)&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl90" style="border-width: 0.5pt 0.5pt 0.5pt 0px; border-style: solid solid solid none; border-color: gainsboro gainsboro gainsboro #333333; width: 187pt; background-color: white;" width="249"&gt;&lt;STRONG style="color: #333333;"&gt;Max Price of either PriceField1 or PriceField2 (based on price of my product and respective competitive products, in multiple stores).&lt;SPAN style="mso-spacerun: yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;In this example, PriceField1 should be used to replace 'x' in the Class function.&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl91" style="border: 0px windowtext; width: 229pt; background-color: transparent;" width="305"&gt;&lt;STRONG&gt;Further, I would like the bucket ranges to be calculated based on the range of the highest price across the 2 price fields and the lowest. In this case, the high price is in PriceField1, and the low price is in PriceField2. Therefore, I want my range to be based on the following:&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl66" height="85" rowspan="5" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; height: 63.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;Product_A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl87" rowspan="5" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;Store1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl69" rowspan="5" style="border-width: 0px 0.5pt; border-style: none solid; border-color: #333333 gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$14.99&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl76" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$14.99&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl69" rowspan="10" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$16.99&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl82" rowspan="10" style="border-width: 0px 0px 0px 0.5pt; border-style: none none none solid; border-color: windowtext windowtext windowtext gainsboro; background-color: transparent;"&gt;$14.79 - $16.99&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl76" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;not priced&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl76" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$15.40&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl69" style="border-width: 0px 0.5pt; border-style: none solid; border-color: #333333 gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;price not available&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl65" height="17" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_E&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl83" style="border: 0.5pt solid gainsboro; background-color: transparent;"&gt;&lt;STRONG style="color: #333333;"&gt;$14.79&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl67" height="85" rowspan="5" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; height: 63.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;Product_A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl87" rowspan="5" style="border-width: 0px 0.5pt 0.5pt; border-style: none solid solid; border-color: #333333 gainsboro gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;Store2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl77" style="border-width: 0px 0px 0.5pt; border-style: none none solid; border-color: #333333 #333333 gainsboro; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl84" rowspan="5" style="border-width: 0.5pt 0.5pt 0px; border-style: solid solid none; border-color: gainsboro gainsboro #333333; background-color: transparent;"&gt;&lt;STRONG style="color: #333333;"&gt;$16.99&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl81" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;not sold in this store&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl77" height="17" style="border-width: 0px 0px 0.5pt; border-style: none none solid; border-color: #333333 #333333 gainsboro; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl78" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;price not available&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl77" height="17" style="border-width: 0px 0px 0.5pt; border-style: none none solid; border-color: #333333 #333333 gainsboro; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl78" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$14.99&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl77" height="17" style="border-width: 0px 0px 0.5pt; border-style: none none solid; border-color: #333333 #333333 gainsboro; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl78" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;store not evaluated&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 12.75pt;"&gt;&lt;TD class="xl77" height="17" style="border-width: 0px 0px 0.5pt; border-style: none none solid; border-color: #333333 #333333 gainsboro; height: 12.75pt; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;CompProd_E&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl78" style="border-width: 0px 0.5pt 0.5pt 0px; border-style: none solid solid none; border-color: #333333 gainsboro gainsboro #333333; background-color: white;"&gt;&lt;SPAN style="color: #333333;"&gt;$14.99&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 16:19:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812652#M286816</guid>
      <dc:creator>ellenblackwell</dc:creator>
      <dc:date>2015-03-30T16:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in Class function</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812653#M286817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure how you are calculating the Bucket... But can try to help you out..&lt;/P&gt;&lt;P&gt;I will provide you how to find out the Max Price and Min Price...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Max Price&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;gt; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Min Price&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;IF(Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;lt; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: underline;"&gt;Max Price &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;- Min Price&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;IF(Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;gt; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;IF(Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1) &amp;lt; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(TOTAL &amp;lt;MyProduct&amp;gt; PriceField1),&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Total &amp;lt;MyProduct&amp;gt; PriceField2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this would help !!&lt;/P&gt;&lt;P&gt;Otherwise, we can have another try with little more explanation from your end!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Mar 2015 20:06:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812653#M286817</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-03-30T20:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variable in Class function</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812654#M286818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;FINAL SOLUTION DETAILS:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Qlik’s popup explanation in dimension’s expression box: &lt;EM&gt;str Class(x, class_width[, forma[, bias]])&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;My Calculated Dimension expression: =class(&lt;EM&gt;$(vBucketPriceField)&lt;/EM&gt;, &lt;EM&gt;$(vBucketBin)&lt;/EM&gt;, '$', &lt;EM&gt;$(vBucketOffset)&lt;/EM&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;Where the variables&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; are defined as . . .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;STRONG style="font-family: 'Arial','sans-serif';"&gt;&lt;EM&gt;vBucketPriceField&lt;/EM&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; To determine which field to use based on highest value between the two fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1in;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;if(MAX(Total&lt;BR /&gt;[PriceField1])&amp;gt;max(Total [PriceField2]) and FLG_Price1_Captured?=1 and FLG_Price2_Captured?=1, [PriceField1], &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(max(total [PriceField2])&amp;gt;MAX(Total [PriceField1]) and FLG_Price1_Captured?=1 and FLG_Price2_Captured=1, [PriceField2])) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;STRONG style="font-family: 'Arial','sans-serif';"&gt;&lt;EM&gt;vBucketBin&lt;/EM&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; The size, or range, of each distinct ‘bucket’&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1in;"&gt;&lt;EM style="font-family: 'Arial','sans-serif';"&gt;$(vBucketRange)&lt;/EM&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;/&lt;EM&gt;$(vBuckets) &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-left: 1in;"&gt;&lt;STRONG style="font-family: 'Arial','sans-serif';"&gt;&lt;EM&gt;vBucketRange&lt;/EM&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; Calculates the full range of prices to be used by finding the highest price across both price fields and subtracting the lowest price across both fields&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1.5in;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;=(if(MAX(Total&lt;BR /&gt;[PriceField1])&amp;gt;max(Total [PriceField2]), Max(Total [PriceField1]), max(Total [PriceField2]))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;BR /&gt;if(Min(Total [PriceField1])&amp;lt;min(Total [PriceField2]), min(Total [PriceField1]), min(Total [PriceField2]))) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 1in;"&gt;&lt;STRONG style="font-family: 'Arial','sans-serif';"&gt;&lt;EM&gt;vBuckets&lt;/EM&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; Defines the number of distinct buckets to be created/displayed in the chart&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A defined set of integers from which the user can select; e.g., 3, 5, 7, 10, etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On app open, d&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;efault value is set.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-left: 0.5in;"&gt;&lt;STRONG style="font-family: 'Arial','sans-serif';"&gt;&lt;EM&gt;vBucketOffset&lt;/EM&gt;:&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt; Used to dynamically create the bias/offset required to capture outliers on the minimum end of the price field spectrum. An absolute value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1in;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;=fabs(min(total [PriceField1])-min(total [PriceField2]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1in;"&gt; &lt;/P&gt;&lt;P style="margin: 0px 0px 0px 1in; text-align: left;"&gt;&lt;SPAN style="font-family: 'Arial','sans-serif';"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="font-size: 14pt;"&gt;* &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;EM style=": ; color: #ff0000; font-size: 10pt;"&gt;The existence (or, lack of existence) of an '=' sign in the variable definition is key. If formula doesn't work, confirm '=' is/is not present, as depicted above, in each variable expression.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 21:18:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-in-Class-function/m-p/812654#M286818</guid>
      <dc:creator>ellenblackwell</dc:creator>
      <dc:date>2015-04-10T21:18:58Z</dc:date>
    </item>
  </channel>
</rss>

