<?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 Set Analysis in Data Load Script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-in-Data-Load-Script/m-p/1556668#M40435</link>
    <description>&lt;P&gt;Hi Qlik Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have a KPI that shows the Average Length of Stay (ALOS) and it's calculated based on the formula listed below Users want to be able to re-use this metric in other apps without having to copy the formula from one to another. Is there a way we can save this metric so it will be as if it were part of the data model?&amp;nbsp; (We know we can use a Master Measure to share the expression between sheets, but we are talking about between apps here)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(&amp;nbsp;&lt;BR /&gt;aggr(max({$&amp;lt;fact_daily_census.admit_discharge_referral_status={'On-Service','Discharged'}&amp;gt;}&amp;nbsp;&lt;BR /&gt;fact_daily_census.onservice_days), [patient_id]) )&amp;nbsp;&lt;BR /&gt;)&amp;nbsp;&lt;BR /&gt;/&amp;nbsp;&lt;BR /&gt;count({$&amp;lt;fact_daily_census.admit_discharge_referral_status={'On-Service', 'Discharged'}&amp;gt;}&amp;nbsp;&lt;BR /&gt;distinct [patient_id])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Our fact table has data as shown in the table below, which was populated based on basic patient info as shown in Table 2.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;patient_id date count onservice_days flag status&amp;nbsp;&lt;BR /&gt;300 6/26/18 1 1 Referred/Admitted On-Service&amp;nbsp;&lt;BR /&gt;300 6/27/18 1 2 On-Service&amp;nbsp;&lt;BR /&gt;300 6/28/18 1 3 On-Service&amp;nbsp;&lt;BR /&gt;300 6/29/18 1 4 On-Service&amp;nbsp;&lt;BR /&gt;300 6/30/18 1 5 On-Service&amp;nbsp;&lt;BR /&gt;300 7/1/18 1 6 On-Service&amp;nbsp;&lt;BR /&gt;300 7/2/18 1 7 Discharged Discharged&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;patient_id referral_date admit_date discharge_date&amp;nbsp;&lt;BR /&gt;300 6/26/18 6/26/18 7/2/18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Qlik support told us we can create a separate QVD to achieve this. Can someone help with the syntax and process here? Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2019 15:55:05 GMT</pubDate>
    <dc:creator>cctien11</dc:creator>
    <dc:date>2019-03-14T15:55:05Z</dc:date>
    <item>
      <title>Set Analysis in Data Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-in-Data-Load-Script/m-p/1556668#M40435</link>
      <description>&lt;P&gt;Hi Qlik Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have a KPI that shows the Average Length of Stay (ALOS) and it's calculated based on the formula listed below Users want to be able to re-use this metric in other apps without having to copy the formula from one to another. Is there a way we can save this metric so it will be as if it were part of the data model?&amp;nbsp; (We know we can use a Master Measure to share the expression between sheets, but we are talking about between apps here)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum(&amp;nbsp;&lt;BR /&gt;aggr(max({$&amp;lt;fact_daily_census.admit_discharge_referral_status={'On-Service','Discharged'}&amp;gt;}&amp;nbsp;&lt;BR /&gt;fact_daily_census.onservice_days), [patient_id]) )&amp;nbsp;&lt;BR /&gt;)&amp;nbsp;&lt;BR /&gt;/&amp;nbsp;&lt;BR /&gt;count({$&amp;lt;fact_daily_census.admit_discharge_referral_status={'On-Service', 'Discharged'}&amp;gt;}&amp;nbsp;&lt;BR /&gt;distinct [patient_id])&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Our fact table has data as shown in the table below, which was populated based on basic patient info as shown in Table 2.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;patient_id date count onservice_days flag status&amp;nbsp;&lt;BR /&gt;300 6/26/18 1 1 Referred/Admitted On-Service&amp;nbsp;&lt;BR /&gt;300 6/27/18 1 2 On-Service&amp;nbsp;&lt;BR /&gt;300 6/28/18 1 3 On-Service&amp;nbsp;&lt;BR /&gt;300 6/29/18 1 4 On-Service&amp;nbsp;&lt;BR /&gt;300 6/30/18 1 5 On-Service&amp;nbsp;&lt;BR /&gt;300 7/1/18 1 6 On-Service&amp;nbsp;&lt;BR /&gt;300 7/2/18 1 7 Discharged Discharged&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;patient_id referral_date admit_date discharge_date&amp;nbsp;&lt;BR /&gt;300 6/26/18 6/26/18 7/2/18&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Qlik support told us we can create a separate QVD to achieve this. Can someone help with the syntax and process here? Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 15:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-in-Data-Load-Script/m-p/1556668#M40435</guid>
      <dc:creator>cctien11</dc:creator>
      <dc:date>2019-03-14T15:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis in Data Load Script</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-in-Data-Load-Script/m-p/1559275#M40734</link>
      <description>&lt;P&gt;We found the answer.&lt;/P&gt;&lt;P&gt;1. define a variable in data load script&lt;/P&gt;&lt;P&gt;2. save the variable into a qvd file then this variable can be used across different apps.&lt;/P&gt;&lt;P&gt;The syntax is as follows:&lt;/P&gt;&lt;P&gt;Let vALOS =&lt;BR /&gt;'sum(&lt;BR /&gt;{$'&amp;amp;'&amp;lt;&lt;BR /&gt;fact_daily_census.admit_discharge_referral_status={"On-Service","Discharged"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;aggr(max({$&amp;lt;fact_daily_census.admit_discharge_referral_status={"On-Service","Discharged"} &amp;gt;}fact_daily_census.onservice_days), [patient_id])&lt;BR /&gt;)&lt;BR /&gt;/&lt;BR /&gt;count({$'&amp;amp;'&amp;lt;&lt;BR /&gt;fact_daily_census.admit_discharge_referral_status={"On-Service", "Discharged"}&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;distinct [patient_id])';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ALOS:&lt;BR /&gt;Load&lt;BR /&gt;'$(vALOS)' as vALOS&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;Store ALOS into [lib://QVD/ALOS.qvd] (qvd);&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 20:38:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-in-Data-Load-Script/m-p/1559275#M40734</guid>
      <dc:creator>cctien11</dc:creator>
      <dc:date>2019-03-20T20:38:12Z</dc:date>
    </item>
  </channel>
</rss>

