<?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: user defined function to select values from a table for subsequent calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766173#M1038621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am 100% sure I have a temp per time. For example if I do following it shows a curve as well: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(temperature,$(udf_svp(20,1)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only in combination of both with time associated values it doesn't work ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(humidity,$(udf_svp(temperature)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah and I just recently figgured out that it also don't work if I do following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(20,$(udf_svp(humidity)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the bug must be somewhere in the function "udf_svp" ... just for the records, I used this one (my columns names are "vp_temp" and "saturated_vapour_pressures":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET udf_svp = Only({&amp;lt;vp_temp={"=vp_temp=round($1)"}&amp;gt;}saturated_vapour_pressures);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 10 Jan 2015 17:08:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-10T17:08:19Z</dc:date>
    <item>
      <title>user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766166#M1038612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use this user defined function to calculate the water content of air. :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;0.622 * (rel. hum * saturated vapour pressure) / (air pressure - rel. hum * saturated vapour pressure)&lt;/P&gt;&lt;P&gt;--&amp;gt; &lt;/P&gt;&lt;P&gt;SET udf_water_content = Num(0.622*($1*$2)/(($3-$1*$2)));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I would like to get the saturated vapour pressure of the measured temperature instead of a fix value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;water_content = $(udf_water_content(humidity,=$(VapPress(=$(round(temperature))),101300));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table with temperatures from -20 to 99 °C with the associated saturated vapour pressures. So how can I define the VapPress function to select the vapour pressure of the associated temperature? Attached you can see an extract of the table with the preassures. The meassured temperatures are floats, so I would need to round them as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="175" style="border: 1px solid rgb(0, 0, 0); width: 245px; height: 143px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;temp&lt;BR /&gt;&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;saturated_vapour_pressures&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1936,2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;18&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2062&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;19&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2196&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2337&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;21&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2485&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;22&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2642&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:31:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766166#M1038612</guid>
      <dc:creator />
      <dc:date>2015-01-09T16:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766167#M1038614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can embed If statements (and I guess other functions) in user defined functions. That said it did take me a while to get the brackets right on this one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="if_statement_in_udf.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75002_if_statement_in_udf.JPG" style="width: 620px; height: 386px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 16:56:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766167#M1038614</guid>
      <dc:creator>chrismarlow</dc:creator>
      <dc:date>2015-01-09T16:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766168#M1038615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The expression to select pressure for a specific temp would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Only({&amp;lt;temp={18}&amp;gt;}saturated_vapour_pressures)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for a rounded value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Only({&amp;lt;temp={$(=round(18.2))}&amp;gt;}saturated_vapour_pressures)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the function version would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Only({&amp;lt;temp={$(=round($1))}&amp;gt;}saturated_vapour_pressures)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The $() is going to give you some grief if you try to define as is with a SET statement. One workaround is to escape the $ using replace like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET VapPress3 = replace(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'Only({&amp;lt;temp={@(=round($1))}&amp;gt;}saturated_vapour_pressures)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;,'@','$');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another alternative to use another expression that doesn't use $().&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SET VapPress = Only({&amp;lt;temp={"=temp=round($1)"}&amp;gt;}saturated_vapour_pressures);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com/" rel="nofollow"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 19:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766168#M1038615</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-09T19:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766169#M1038617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first of all I would like to thank you for your detailed reply! But I still got one issue. When I use your function to select the associated saturated vapour pressure it works with a manual entered temperature. It works as well when I insert the function in my first function. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Functions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SET udf_wc = Num(0.622*(($1*$2)/(($3-$1)*$2)));&lt;/P&gt;&lt;P&gt;SET udf_svp = Only({&amp;lt;vp_temp={"=vp_temp=round($1)"}&amp;gt;}saturated_vapour_pressures);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Correct result with following functions&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;=$(udf_svp(18.2))&lt;/P&gt;&lt;P&gt;=$(udf_wc(50,$(udf_svp(18.2)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now it comes to diagramms. I use a table with measured data containing the columns "time", "temperature" and, "humidity".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I choose "time" as the dimension, I can use the function "=$(udf_wc(humidity,2337,101300))" correctly. It also works, when I do this: "=$(udf_wc(humidity,$(udf_svp(20)),101300))". But if I try this "=$(udf_wc(humidity,$(udf_svp(temperature)),101300))" it doesn't work. But I absolutely have no clue why. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 21:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766169#M1038617</guid>
      <dc:creator />
      <dc:date>2015-01-09T21:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766170#M1038618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There has to be a single temperature value for the row. If not, some type of aggregation function needs to be used like:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=$(udf_wc(humidity,$(udf_svp(max(temperature))),101300))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Could that be the issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jan 2015 23:53:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766170#M1038618</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-09T23:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766171#M1038619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there exists a single temperature value for every row. Same as for humidity. So I don't get why it isn't working &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt; If I use the max() function, all of the calculation works with one temperature value (in my case 21°C). So the diagramm result shows the same curve as the rel. humidity curve and that is not correct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br&lt;/P&gt;&lt;P&gt;henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 09:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766171#M1038619</guid>
      <dc:creator />
      <dc:date>2015-01-10T09:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766172#M1038620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It sounds like you have more than one temp per time, or that time snd temp are not properly associated. Can you post a sample qvw?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 15:15:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766172#M1038620</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-10T15:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766173#M1038621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am 100% sure I have a temp per time. For example if I do following it shows a curve as well: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(temperature,$(udf_svp(20,1)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only in combination of both with time associated values it doesn't work ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(humidity,$(udf_svp(temperature)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah and I just recently figgured out that it also don't work if I do following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=$(udf_wc(20,$(udf_svp(humidity)),101300))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the bug must be somewhere in the function "udf_svp" ... just for the records, I used this one (my columns names are "vp_temp" and "saturated_vapour_pressures":&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET udf_svp = Only({&amp;lt;vp_temp={"=vp_temp=round($1)"}&amp;gt;}saturated_vapour_pressures);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 17:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766173#M1038621</guid>
      <dc:creator />
      <dc:date>2015-01-10T17:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766174#M1038622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your chart type to a Straight Table and use an empty label. You should be able to see the substituted formulas in the headings. You can try it piece by piece. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 17:22:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766174#M1038622</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-10T17:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766175#M1038623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried ... this is the result ... can't figure out why it isn't working:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="test_table_01.png" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75045_test_table_01.png" style="height: 245px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="test_table_02.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/75046_test_table_02.png" style="height: 245px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 18:14:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766175#M1038623</guid>
      <dc:creator />
      <dc:date>2015-01-10T18:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766176#M1038624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;instead of using a lookup table you could also calculate the saturated vapour pressure&lt;/P&gt;&lt;P&gt;e.g. as defined by the International Association for the Properties of Water and Steam (&lt;A href="http://www.iapws.org/index.html" title="http://www.iapws.org/index.html"&gt;International Association for the Properties of Water and Steam&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.iapws.org/relguide/IF97-Rev.pdf" title="http://www.iapws.org/relguide/IF97-Rev.pdf"&gt;http://www.iapws.org/relguide/IF97-Rev.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14209286555126732 jive_text_macro jive_macro_code" jivemacro_uid="_14209286555126732"&gt;
&lt;P&gt;LET vN1&amp;nbsp; = 0.11670521452767e4;&lt;/P&gt;
&lt;P&gt;LET vN2&amp;nbsp; = -0.72421316703206e6;&lt;/P&gt;
&lt;P&gt;LET vN3&amp;nbsp; = -0.17073846940092e2;&lt;/P&gt;
&lt;P&gt;LET vN4&amp;nbsp; = 0.12020824702470e5;&lt;/P&gt;
&lt;P&gt;LET vN5&amp;nbsp; = -0.32325550322333e7;&lt;/P&gt;
&lt;P&gt;LET vN6&amp;nbsp; = 0.14915108613530e2;&lt;/P&gt;
&lt;P&gt;LET vN7&amp;nbsp; = -0.48232657361591e4;&lt;/P&gt;
&lt;P&gt;LET vN8&amp;nbsp; = 0.40511340542057e6;&lt;/P&gt;
&lt;P&gt;LET vN9&amp;nbsp; = -0.23855557567849;&lt;/P&gt;
&lt;P&gt;LET vN10 = 0.65017534844798e3;&lt;/P&gt;
&lt;P&gt;SET vϑ = ($1+273.15+$(vN9)/($1+273.15-$(vN10)));&lt;/P&gt;
&lt;P&gt;SET vA = (pow($(vϑ($1)),2)+$(vN1)*$(vϑ($1))+$(vN2));&lt;/P&gt;
&lt;P&gt;SET vB = ($(vN3)*pow($(vϑ($1)),2)+$(vN4)*$(vϑ($1))+$(vN5));&lt;/P&gt;
&lt;P&gt;SET vC = ($(vN6)*pow($(vϑ($1)),2)+$(vN7)*$(vϑ($1))+$(vN8));&lt;/P&gt;
&lt;P&gt;SET vp = pow(2*$(vC($1))/(-$(vB($1))+pow(pow($(vB($1)),2)-4*$(vA($1))*$(vC($1)),0.5)),4)*1e6;&lt;/P&gt;
&lt;P&gt;SET VapPress = Dual(Num($(vp($1)),'0.0')&amp;amp;' Pa',$(vp($1)));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SET udf_water_content = Num(0.622*($1*$2)/(($3-$1*$2))*1000);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabHumidity:&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(udf_water_content(rel.hum, sat_vap_pres, 101300)) as water_content;&lt;/P&gt;
&lt;P&gt;LOAD *,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(vp(temp)) as sat_vap_pres;&lt;/P&gt;
&lt;P&gt;LOAD Dual(RecNo()&amp;amp;' RH%', RecNo()/100) as rel.hum,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual(IterNo()-1&amp;amp;' °C', IterNo()-1) as temp&lt;/P&gt;
&lt;P&gt;AutoGenerate 100&lt;/P&gt;
&lt;P&gt;While IterNo()&amp;lt;102;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabSatVapPress:&lt;/P&gt;
&lt;P&gt;LOAD temp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(VapPress(temp)) as VapPress&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="jive-link-thread-small" data-containerid="2003" data-containertype="14" data-objectid="147952" data-objecttype="1" href="http://community.qlik.com/thread/147952"&gt;http://community.qlik.com/thread/147952&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, embedded labels, table is @1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_147952_Pic1.JPG" class="image-1 jive-image" src="https://community.qlik.com/legacyfs/online/75049_QlikCommunity_Thread_147952_Pic1.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_147952_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/75050_QlikCommunity_Thread_147952_Pic2.JPG" style="height: 577px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_147952_Pic3.JPG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/75051_QlikCommunity_Thread_147952_Pic3.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 22:25:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766176#M1038624</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-10T22:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766177#M1038625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any chance you could upload a sample qvw?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 Jan 2015 22:50:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766177#M1038625</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-10T22:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766178#M1038626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;attached you can find a sample qvw with an excel sheet including some sample data and the saturated vapour pressures table. Thanks for reviewing! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:10:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766178#M1038626</guid>
      <dc:creator />
      <dc:date>2015-01-15T15:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766179#M1038627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for the huge effort you invested to help me out, but I hope to find a much easier solution. Especially to transfer the approach to similar issues, because this is a very unike solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;BR /&gt;Henrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 15:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766179#M1038627</guid>
      <dc:creator />
      <dc:date>2015-01-15T15:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: user defined function to select values from a table for subsequent calculation</title>
      <link>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766180#M1038628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at your qvw and realized I took you down the wrong path with the Set expression. That is not going to work row by row. This will work as a chart expression though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;&amp;nbsp; SET udf_svp = only(if(vp_temp = Round($1), saturated_vapour_pressures));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;&amp;nbsp; $(udf_svp(temperature))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I don't know if it fits your original requirement, but in your script you could add &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;&amp;nbsp; .round(temperature) as vp_temp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;to the data table which would create a linkage between temperature and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;saturated_vapour_pressures.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;-Rob&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Jan 2015 23:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/user-defined-function-to-select-values-from-a-table-for/m-p/766180#M1038628</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-01-15T23:10:07Z</dc:date>
    </item>
  </channel>
</rss>

