<?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 Unit of Measure conversion in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Unit-of-Measure-conversion/m-p/1617148#M45930</link>
    <description>&lt;P&gt;I am having some trouble with unit of measure conversions.&amp;nbsp; I am using a preceding load on my fact table (Assessments) to take one field (value) and convert based on the unit of measure for a performance item(PI) from a bridge table. Please see the attached sample data set.&amp;nbsp; The values in the fact table are stored at the lowest unit of measure but based on the Display Unit of Measure I would like to show the values in the correct format. Below is a stripped down version of my load script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Load*,&lt;BR /&gt;if(match(UoMSK, '15')and Value&amp;lt;1 and match(PerformanceItemSK, '23', '24', '25', '26') , Value*100,&lt;BR /&gt;if(match(UOMUnits,'Ft/In', 'ft/in'), Num(Round(Value/12,0.01)),&lt;BR /&gt;if(match(UOMUnits, 'min/sec', 'Min:Sec'), Time(Value/(3600*24),'hh:mm:ss'),&lt;BR /&gt;if(match(UOMUnits, 'Hrs/Min'), Time(Value/(3600*24),'hh:mm'), Value)&lt;BR /&gt;))) as ValueConverted&lt;BR /&gt;;&lt;BR /&gt;Load*,&lt;BR /&gt;applymap('UOM_Map', %UOMKey, 'No units') as UOMUnits,&lt;BR /&gt;applymap('PerformanceItemMap', %PerformanceItemSK) as PerformanceItemMaster;&lt;BR /&gt;LOAD&lt;BR /&gt;LOBSK,&lt;BR /&gt;LOBSK&amp;amp;'|'&amp;amp;PerformanceItemSK as %UOMKey,&lt;BR /&gt;FactSK, // primary&lt;BR /&gt;PersonSK as %PersonSK, // key&lt;BR /&gt;PerformanceItemSK as %PerformanceItemSK,&lt;BR /&gt;PerformanceItemSK,&lt;BR /&gt;AssessmentSK,&amp;nbsp;&lt;BR /&gt;date(AssessmentDate, 'MM/DD/YYYY') as AssessmentDate, // key&lt;BR /&gt;Value&lt;BR /&gt;FROM [lib://QVD/Assessments.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Example data set Broad jumps Value is 75 inches but I would like for the value converted to display as 6' 3". With the current conversion it would show as 6.25 with no ft/in specified. The same goes for the timed PI's, 800 M Swim is stored as 1020 seconds which converted be 00:17:00 minutes.&amp;nbsp; The overall goal is to have a bar chart with a filter that displays the counts of each value based on the PI selected. Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sampleqlik.PNG" style="width: 553px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/17885i4689D2B96A35DC7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="sampleqlik.PNG" alt="sampleqlik.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 27 Aug 2019 14:34:08 GMT</pubDate>
    <dc:creator>philip_radovich</dc:creator>
    <dc:date>2019-08-27T14:34:08Z</dc:date>
    <item>
      <title>Unit of Measure conversion</title>
      <link>https://community.qlik.com/t5/App-Development/Unit-of-Measure-conversion/m-p/1617148#M45930</link>
      <description>&lt;P&gt;I am having some trouble with unit of measure conversions.&amp;nbsp; I am using a preceding load on my fact table (Assessments) to take one field (value) and convert based on the unit of measure for a performance item(PI) from a bridge table. Please see the attached sample data set.&amp;nbsp; The values in the fact table are stored at the lowest unit of measure but based on the Display Unit of Measure I would like to show the values in the correct format. Below is a stripped down version of my load script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Load*,&lt;BR /&gt;if(match(UoMSK, '15')and Value&amp;lt;1 and match(PerformanceItemSK, '23', '24', '25', '26') , Value*100,&lt;BR /&gt;if(match(UOMUnits,'Ft/In', 'ft/in'), Num(Round(Value/12,0.01)),&lt;BR /&gt;if(match(UOMUnits, 'min/sec', 'Min:Sec'), Time(Value/(3600*24),'hh:mm:ss'),&lt;BR /&gt;if(match(UOMUnits, 'Hrs/Min'), Time(Value/(3600*24),'hh:mm'), Value)&lt;BR /&gt;))) as ValueConverted&lt;BR /&gt;;&lt;BR /&gt;Load*,&lt;BR /&gt;applymap('UOM_Map', %UOMKey, 'No units') as UOMUnits,&lt;BR /&gt;applymap('PerformanceItemMap', %PerformanceItemSK) as PerformanceItemMaster;&lt;BR /&gt;LOAD&lt;BR /&gt;LOBSK,&lt;BR /&gt;LOBSK&amp;amp;'|'&amp;amp;PerformanceItemSK as %UOMKey,&lt;BR /&gt;FactSK, // primary&lt;BR /&gt;PersonSK as %PersonSK, // key&lt;BR /&gt;PerformanceItemSK as %PerformanceItemSK,&lt;BR /&gt;PerformanceItemSK,&lt;BR /&gt;AssessmentSK,&amp;nbsp;&lt;BR /&gt;date(AssessmentDate, 'MM/DD/YYYY') as AssessmentDate, // key&lt;BR /&gt;Value&lt;BR /&gt;FROM [lib://QVD/Assessments.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Example data set Broad jumps Value is 75 inches but I would like for the value converted to display as 6' 3". With the current conversion it would show as 6.25 with no ft/in specified. The same goes for the timed PI's, 800 M Swim is stored as 1020 seconds which converted be 00:17:00 minutes.&amp;nbsp; The overall goal is to have a bar chart with a filter that displays the counts of each value based on the PI selected. Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sampleqlik.PNG" style="width: 553px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/17885i4689D2B96A35DC7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="sampleqlik.PNG" alt="sampleqlik.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 14:34:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Unit-of-Measure-conversion/m-p/1617148#M45930</guid>
      <dc:creator>philip_radovich</dc:creator>
      <dc:date>2019-08-27T14:34:08Z</dc:date>
    </item>
  </channel>
</rss>

