<?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: Read formula from Excel file and apply in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602001#M444408</link>
    <description>&lt;P&gt;Check this,&lt;/P&gt;&lt;P&gt;I am not still clear, what your'e trying to achieve.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAP_THRESHOLD:
Mapping LOAD * INLINE [
    THRESHOLD, CODE
    AGE&amp;gt;15, AJS
    AGE&amp;lt;3, AJSS
];

Age:
Load *,
If (Len(applymap('MAP_THRESHOLD',Age_Bucket))&amp;gt;=1,1,0) as Dimension,
applymap('MAP_THRESHOLD',Age_Bucket,'#NA') as CODE;
LOAD *,
If(Age&amp;gt;15,'AGE&amp;gt;15',
IF( Age&amp;lt;3, 'AGE&amp;lt;3')) as Age_Bucket
INLINE [
    Age
    1
    2
    66
    16
    7
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 13 Jul 2019 06:26:32 GMT</pubDate>
    <dc:creator>HirisH_V7</dc:creator>
    <dc:date>2019-07-13T06:26:32Z</dc:date>
    <item>
      <title>Read formula from Excel file and apply in script</title>
      <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1601998#M444407</link>
      <description>&lt;P&gt;I have an excel sheet in which i have defined formulas for each of the CODE as follows:&lt;/P&gt;&lt;P&gt;CODE, THRESHOLD&lt;/P&gt;&lt;P&gt;AJS,AGE&amp;gt;15&lt;/P&gt;&lt;P&gt;AJSS, AGE&amp;lt;3&lt;/P&gt;&lt;P&gt;AGE is a column name in the same table&lt;/P&gt;&lt;P&gt;How can i use the THRESHOLD as a formula and then use it to define a dimension.&amp;nbsp; Something as below&lt;/P&gt;&lt;P&gt;if (applymap('MAP_THRESHOLD',CODE,null()),1,0)&amp;nbsp;&lt;/P&gt;&lt;P&gt;The applymap will return the formula and then i can apply it in the if condition.&amp;nbsp; Is there a way to use it?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:00:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1601998#M444407</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2024-11-16T03:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Read formula from Excel file and apply in script</title>
      <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602001#M444408</link>
      <description>&lt;P&gt;Check this,&lt;/P&gt;&lt;P&gt;I am not still clear, what your'e trying to achieve.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAP_THRESHOLD:
Mapping LOAD * INLINE [
    THRESHOLD, CODE
    AGE&amp;gt;15, AJS
    AGE&amp;lt;3, AJSS
];

Age:
Load *,
If (Len(applymap('MAP_THRESHOLD',Age_Bucket))&amp;gt;=1,1,0) as Dimension,
applymap('MAP_THRESHOLD',Age_Bucket,'#NA') as CODE;
LOAD *,
If(Age&amp;gt;15,'AGE&amp;gt;15',
IF( Age&amp;lt;3, 'AGE&amp;lt;3')) as Age_Bucket
INLINE [
    Age
    1
    2
    66
    16
    7
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 06:26:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602001#M444408</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2019-07-13T06:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Read formula from Excel file and apply in script</title>
      <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602008#M444409</link>
      <description>&lt;P&gt;hirishv7,&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;Actually what I want is to have an kind of formula as a text in the field (AGE was just an example)&lt;/P&gt;&lt;P&gt;CODE, FORMULA&lt;/P&gt;&lt;P&gt;AJS, SALES&amp;gt;100&lt;/P&gt;&lt;P&gt;AJSS, SALES &amp;lt;50&lt;/P&gt;&lt;P&gt;I want to read the formula and then apply it as a condition.&amp;nbsp; The applymap will give me the formula but how can i apply the formula as a condition.&lt;/P&gt;&lt;P&gt;applymap('MAP_THRESHOLD',CODE,null()) will give me the FORMULA&lt;/P&gt;&lt;P&gt;if(applymap('MAP_THRESHOLD',CODE,nul()),1,0) should give me the following&lt;/P&gt;&lt;P&gt;if(SALES&amp;gt;100,1,0)&lt;/P&gt;&lt;P&gt;but the challenge it is that it is returning text and i cannot use SALES&amp;gt;100 as formula.&lt;/P&gt;&lt;P&gt;Hope this clears.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jul 2019 09:22:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602008#M444409</guid>
      <dc:creator>sjhussain</dc:creator>
      <dc:date>2019-07-13T09:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Read formula from Excel file and apply in script</title>
      <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602182#M444415</link>
      <description>&lt;P&gt;Check this, using evaluate function.&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Map:
Mapping LOAD * INLINE [
CODE, FORMULA
AJS, SALES&amp;gt;100
AJSS, SALES&amp;lt;50
];


SET vEval = Evaluate($1&amp;amp;$2);

Data:
LOAD *,
If($(vEval(SALES,Evaluator)),1,0) AS Validate;
LOAD *,
Mid(ApplyMap('Map',CODE),6) as Evaluator
INLINE [
CODE,SALES
AJS, 55
AJA, 89
AJS, 110
AJSS, 40
AJSS, 90
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;PFA for ref.&lt;/P&gt;&lt;P&gt;Hirish&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2019 08:33:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1602182#M444415</guid>
      <dc:creator>HirisH_V7</dc:creator>
      <dc:date>2019-07-15T08:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read formula from Excel file and apply in script</title>
      <link>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1610350#M445082</link>
      <description>&lt;P&gt;Did Hirish's last comment and example app solve your issue?&amp;nbsp; If it did, be sure to give him credit by clicking the Accept as Solution button on the post.&amp;nbsp; If you are still stuck or you did something else to solve things, it would be great if you can post that and mark that as the solution...&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2019 16:15:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-formula-from-Excel-file-and-apply-in-script/m-p/1610350#M445082</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-08-07T16:15:28Z</dc:date>
    </item>
  </channel>
</rss>

