<?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: Location Deatils in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427630#M96274</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/285770"&gt;@LRuCelver&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;it should be like if SensorID in the incident table is available in the sensor table.SensorID&lt;/P&gt;
&lt;P&gt;here the sensor table data is current data and incident data is like today or created long back&lt;/P&gt;
&lt;P&gt;fpr example sensorid 23407 created incident yesterday and today we delted that sensor (in this case the incident created in the past dont have the loaction as it will be unavailable after deleting that sensorid,hence we will fectch location from Incident_name created out of that Sensorid).&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2024 09:38:58 GMT</pubDate>
    <dc:creator>Raju_6952</dc:creator>
    <dc:date>2024-03-06T09:38:58Z</dc:date>
    <item>
      <title>Location Deatils</title>
      <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427580#M96268</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a scenario in Qlik sense that I am extracting the facility field from sensor group, the problem is that if that sensor group is deleted then we are extracting location from Incident that is created by the sensor which is deleted.&lt;/P&gt;
&lt;P&gt;I am trying to implement logic like if the sensorID is available in the sensor table then it should take the facility from sensor table and if it's deleted then it should take the Facility from Incident Table.&lt;/P&gt;
&lt;P&gt;Your suggestions would be highly appreciated...&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 08:45:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427580#M96268</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2024-03-06T08:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Location Deatils</title>
      <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427587#M96269</link>
      <description>&lt;P&gt;Does this what you need?&lt;/P&gt;
&lt;PRE&gt;If(IsNull([SensorTable.Facility]), [IncidentTable.Facility], [SensorTable.Facility])&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 08:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427587#M96269</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-06T08:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Location Deatils</title>
      <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427630#M96274</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/285770"&gt;@LRuCelver&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;it should be like if SensorID in the incident table is available in the sensor table.SensorID&lt;/P&gt;
&lt;P&gt;here the sensor table data is current data and incident data is like today or created long back&lt;/P&gt;
&lt;P&gt;fpr example sensorid 23407 created incident yesterday and today we delted that sensor (in this case the incident created in the past dont have the loaction as it will be unavailable after deleting that sensorid,hence we will fectch location from Incident_name created out of that Sensorid).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 09:38:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427630#M96274</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2024-03-06T09:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Location Deatils</title>
      <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427667#M96281</link>
      <description>&lt;P&gt;Here are a few examples since I don't know the structure of your data model:&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;1. No dates; Tables are linked via SensorID&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_1-1709719273024.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161419iAEA001368E679F16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_1-1709719273024.png" alt="LRuCelver_1-1709719273024.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Using this expression will result in the 4th column:&lt;/P&gt;
&lt;PRE&gt;If(IsNull(SensorFacility), IncidentFacility, SensorFacility)&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_2-1709719310213.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161420i6678BB638EB8CF7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_2-1709719310213.png" alt="LRuCelver_2-1709719310213.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;2. Separate&amp;nbsp;dates; Tables are linked via SensorID&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_3-1709719440309.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161421iDB14147F0B1D4D27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_3-1709719440309.png" alt="LRuCelver_3-1709719440309.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this case we need to find the most recent date and go select the field accordingly:&lt;/P&gt;
&lt;PRE&gt;If(RangeMax(Max(SensorDate), 0) &amp;gt;= RangeMax(Max(IncidentDate), 0), FirstSortedValue(SensorFacility, -SensorDate), FirstSortedValue(IncidentFacility, -IncidentDate))&lt;/PRE&gt;
&lt;P&gt;Left: Datamodel; Right: Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_4-1709719932980.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161422i727EA7CFE9814016/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_4-1709719932980.png" alt="LRuCelver_4-1709719932980.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;3.&amp;nbsp;Tables are linked via Date and SensorID&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_6-1709720472743.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161424iE7782CAEF1FEB0EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_6-1709720472743.png" alt="LRuCelver_6-1709720472743.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In this case we can apply the expression from case 1 to all dates and select the one from the most recent date:&lt;/P&gt;
&lt;PRE&gt;FirstSortedValue(If(IsNull(SensorFacility), IncidentFacility, SensorFacility), -Date)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Left: Datamodel; Right: Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LRuCelver_7-1709720643570.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/161425iE2DAEC3EBEF4D332/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LRuCelver_7-1709720643570.png" alt="LRuCelver_7-1709720643570.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4&gt;&lt;STRONG&gt;Load Scripts for all examples&lt;/STRONG&gt;&lt;/H4&gt;
&lt;P&gt;1:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SensorData:
NoConcatenate Load * Inline [
	SensorID, SensorFacility
    1, A
    2, B
];

IncidentData:
NoConcatenate Load * Inline [
	SensorID, IncidentFacility
    2, C
    3, D
];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SensorData:
NoConcatenate Load * Inline [
	SensorDate, SensorID, SensorFacility
    20240301, 1, A
    20240302, 1, B
    20240301, 2, B
    20240302, 3, B
    20240301, 4, B
];

IncidentData:
NoConcatenate Load * Inline [
	IncidentDate, SensorID, IncidentFacility
    20240302, 2, C
    20240301, 3, C
    20240301, 4, C
    20240301, 5, C
    20240302, 5, D
];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SensorData:
NoConcatenate Load
	*,
    AutoNumberHash128(Date, SensorID) as DateSensorKey
Inline [
	Date, SensorID, SensorFacility
    20240301, 1, A
    20240302, 1, B
    20240301, 2, B
    20240302, 3, B
    20240301, 4, B
];

IncidentData:
NoConcatenate Load
	*,
    AutoNumberHash128(Date, SensorID) as DateSensorKey
Inline [
	Date, SensorID, IncidentFacility
    20240302, 2, C
    20240301, 3, C
    20240301, 4, C
    20240301, 5, C
    20240302, 5, D
];

LinkTable:
NoConcatenate Load Distinct
	Date,
    SensorID,
    DateSensorKey,
    DateSensorKey as Temp_DateSensorKey
Resident SensorData;

Concatenate Load Distinct
	Date,
    SensorID,
    DateSensorKey,
    DateSensorKey as Temp_DateSensorKey
Resident IncidentData
Where not Exists(Temp_DateSensorKey, DateSensorKey);

Drop Field Temp_DateSensorKey;
Drop Fields Date, SensorID From SensorData, IncidentData;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Mar 2024 10:25:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427667#M96281</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-06T10:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Location Deatils</title>
      <link>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427725#M96286</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/285770"&gt;@LRuCelver&lt;/a&gt;LRuCelver,&lt;/P&gt;
&lt;P&gt;Thanks for the hint, but we don't have any date field in the sensor table, only incidents table we are extracting from creation time of each Incident.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 11:59:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Location-Deatils/m-p/2427725#M96286</guid>
      <dc:creator>Raju_6952</dc:creator>
      <dc:date>2024-03-06T11:59:45Z</dc:date>
    </item>
  </channel>
</rss>

