<?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: How can I obtain a value by interpolation from a large dataset in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111365#M90779</link>
    <description>&lt;P&gt;Hi, I'll provide my toughs how I would try to solve this. First, I would merge all possible values into one table, so you have&lt;BR /&gt;Gender |Age |Hz |Best |Worst&lt;BR /&gt;Male |20 |500 |0 |5,5&lt;BR /&gt;Male |20 |1000 |0 |6&lt;BR /&gt;...&lt;BR /&gt;Female |70 |6000 |? |?&lt;BR /&gt;Female |70 |8000 |? |? &lt;BR /&gt;Then, as you have your subjects gender/age/frequency you can 'look' (left join in load script, or some aggregation in report level) between lower and higher ranges you know.&lt;BR /&gt;In your case, your subject female age is 25. Floor(subject_age/10)*10 will give you age 20 (lower known range) and ceil(subject_age/10)*10 will give you age 30 (higher known range). From your merged main table you take possible values for female/3000hz for ages corresponding lower/higher (floor/ceil) age ranges. So you have something like this:&lt;BR /&gt;Gender |subject_age |Hz |Age_low |Best_low |Worst_low |Age_high |Best_high |Worst_high&lt;BR /&gt;Female |25 |3000 |20 |0 |5,2 |30 |0,4 |6,2&lt;BR /&gt;And now you just calculate Best/Worst values according subject_age, something like:&lt;BR /&gt;(Best_high-Best_low)/(10*(subject_age-Age_low))+Best_low&lt;BR /&gt;(Worst_high-Worst_low)/(10*(subject_age-Age_low))+Worst_low&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2023 12:38:18 GMT</pubDate>
    <dc:creator>justISO</dc:creator>
    <dc:date>2023-08-30T12:38:18Z</dc:date>
    <item>
      <title>How can I obtain a value by interpolation from a large dataset</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111049#M90753</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I am trying to think of a way to interpolate and calculate a value. &lt;BR /&gt;This is the scenario: a person in a certain age, has an expected minimum and maximum hearing loss per frequency.&lt;/P&gt;
&lt;P&gt;I know for 7 frequencies (Hz) what the expected min/max loss is (in dB) per biogender (m/f) and per age.&lt;/P&gt;
&lt;P&gt;In my dashboard I do already have values for the variables 'var_Gender', 'var_Age' and (for each ear (left/right), score per frequency) 'var_Left_500/var_Left_1000' and so on.&lt;/P&gt;
&lt;P&gt;So now I 'only' need Qlikview to 'learn' the dataset (some smart LOAD INLINE probably).&lt;/P&gt;
&lt;P&gt;This is how it looks in Excel for only the category 20 and 30 years of age (but there are many more (up to 70 years)):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MrBosch_0-1693333658171.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/115333i13E0D1E78FB5BCF5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MrBosch_0-1693333658171.png" alt="MrBosch_0-1693333658171.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How would I be able to store all these numbers per frequency, age and gender, so when I select one person, it can calculate the interpolated (if required... when the age is in between the 20 and 30 in this example) Best and Worst value?&lt;/P&gt;
&lt;P&gt;So if our subject is a 25 year old female and we look at 3000Hz, the expected outcome would be 0,2 as best and 5,7 as worst loss.&lt;/P&gt;
&lt;P&gt;Anyone an idea?&lt;/P&gt;
&lt;P&gt;I would like to thank you in advance already for even reading this and thinking about it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 06:55:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111049#M90753</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2023-08-30T06:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a value by interpolation from a large dataset</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111365#M90779</link>
      <description>&lt;P&gt;Hi, I'll provide my toughs how I would try to solve this. First, I would merge all possible values into one table, so you have&lt;BR /&gt;Gender |Age |Hz |Best |Worst&lt;BR /&gt;Male |20 |500 |0 |5,5&lt;BR /&gt;Male |20 |1000 |0 |6&lt;BR /&gt;...&lt;BR /&gt;Female |70 |6000 |? |?&lt;BR /&gt;Female |70 |8000 |? |? &lt;BR /&gt;Then, as you have your subjects gender/age/frequency you can 'look' (left join in load script, or some aggregation in report level) between lower and higher ranges you know.&lt;BR /&gt;In your case, your subject female age is 25. Floor(subject_age/10)*10 will give you age 20 (lower known range) and ceil(subject_age/10)*10 will give you age 30 (higher known range). From your merged main table you take possible values for female/3000hz for ages corresponding lower/higher (floor/ceil) age ranges. So you have something like this:&lt;BR /&gt;Gender |subject_age |Hz |Age_low |Best_low |Worst_low |Age_high |Best_high |Worst_high&lt;BR /&gt;Female |25 |3000 |20 |0 |5,2 |30 |0,4 |6,2&lt;BR /&gt;And now you just calculate Best/Worst values according subject_age, something like:&lt;BR /&gt;(Best_high-Best_low)/(10*(subject_age-Age_low))+Best_low&lt;BR /&gt;(Worst_high-Worst_low)/(10*(subject_age-Age_low))+Worst_low&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 12:38:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111365#M90779</guid>
      <dc:creator>justISO</dc:creator>
      <dc:date>2023-08-30T12:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a value by interpolation from a large dataset</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111410#M90784</link>
      <description>&lt;P&gt;I think I would simply create a record for each year and KEY and using a mapping-approach to interpolate the values.&lt;/P&gt;
&lt;P&gt;The mapping would be quite simple, like:&lt;/P&gt;
&lt;P&gt;m: mapping load Age &amp;amp; Gender &amp;amp; Frequency, Best &amp;amp; '|' &amp;amp; Worst from Source;&lt;/P&gt;
&lt;P&gt;At next would the age offset between the ages added respectively included - if they are always 10 years this step isn't necessary - and this might be done with another mapping or maybe a pick(match()) and then the final population-load with interpolation of the values, with something like this:&lt;/P&gt;
&lt;P&gt;load *, Value + ((Best - Value) /&amp;nbsp;applymap('mapOffset', Age, 0) * IterNo) as newValue;&lt;BR /&gt;load *, Age + IterNo - 1 as newAge, subfield(BestWorst, '|', 1) as Best, ...;&lt;BR /&gt;load *, applymap('m',&amp;nbsp; Age &amp;amp; Gender &amp;amp; Frequency, null()) as BestWorst, iterno() as IterNo&lt;BR /&gt;from Source&amp;nbsp;while iterno() - 1 &amp;lt;= applymap('mapOffset', Age, 0);&lt;/P&gt;
&lt;P&gt;You may need a bit adjustments, for example to set the iterno() right - as iterator and to add the age and to calculate the interpolation value - but in general this approach should work.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 13:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2111410#M90784</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-08-30T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I obtain a value by interpolation from a large dataset</title>
      <link>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2112344#M90857</link>
      <description>&lt;P&gt;Thank you both for your answers. I believe (I am not the expert) they can both work!&lt;/P&gt;
&lt;P&gt;Great thing is that I completely understand JustISO's approach and even came up with another possibility:&lt;BR /&gt;I will create a 'flat' table in Excel, doing al the interpolation just there and create a min|max for each freq and gender. &lt;BR /&gt;I can import this or... (perhaps) ask ChatGPT to define a function based upon all these X,Y values to create the 'best effort' F(x){gender|age}: that then can calculate the Min or Max for each situation!&lt;/P&gt;
&lt;P&gt;Again thank you both. I will have a great weekend reaching the goal by spending some quality time with Qlikview! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 14:12:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-can-I-obtain-a-value-by-interpolation-from-a-large-dataset/m-p/2112344#M90857</guid>
      <dc:creator>MrBosch</dc:creator>
      <dc:date>2023-09-01T14:12:55Z</dc:date>
    </item>
  </channel>
</rss>

