<?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: Count Missing Utilization in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955690#M78807</link>
    <description>&lt;P&gt;Hi, you can create a flag and use it in set analysis like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;temp:
LOAD
machine_number,
date,
begin_time,
end_time,
FABS(MATCH(begin_time,end_time)) AS missing_utilization_flag
INLINE [
machine_number,date,begin_time,end_time
A123,01.07.2022,00:24:00,00:30:00
A123,02.07.2022,01:24:00,01:30:00
A123,03.07.2022,02:24:00,02:30:00
A123,04.07.2022,00:24:00,00:24:00
A123,05.07.2022,03:24:00,03:30:00
A123,06.07.2022,04:24:00,04:30:00
A123,07.07.2022,05:24:00,05:30:00
A123,08.07.2022,05:24:00,04:30:00
A123,09.07.2022,07:24:00,07:30:00
A123,10.07.2022,08:24:00,08:30:00
B123,03.07.2022,02:24:00,02:30:00
B123,04.07.2022,00:24:00,00:24:00
B123,05.07.2022,03:24:00,03:30:00
C123,05.07.2022,03:24:00,03:30:00
C123,06.07.2022,01:24:00,17:30:00
C123,07.07.2022,05:24:00,05:30:00
C123,08.07.2022,06:24:00,06:30:00
C123,09.07.2022,07:24:00,07:30:00
];

temp_key:
LOAD DISTINCT
machine_number,
date
RESIDENT temp;

LEFT JOIN (temp)
LOAD *,
machine_number &amp;amp; '|' &amp;amp; NUM(date) as machine_date.#key
RESIDENT temp_key;

DROP TABLE temp_key;

temp_missing_records:
LOAD
NUM(FIELDVALUE('date',RECNO())) AS date
AUTOGENERATE FIELDVALUECOUNT('date');

JOIN (temp_missing_records)
LOAD
FIELDVALUE('machine_number',RECNO()) AS machine_number
AUTOGENERATE FIELDVALUECOUNT('machine_number');

INNER JOIN (temp_missing_records)
LOAD
1 AS missing_utilization_flag
AUTOGENERATE 1;

temp_missing_records2:
LOAD
machine_number &amp;amp; '|' &amp;amp; NUM(date) as machine_date_conc.#key,
date,
machine_number,
missing_utilization_flag
RESIDENT temp_missing_records;

DROP TABLE temp_missing_records;

CONCATENATE (temp)
LOAD *,
machine_date_conc.#key as [machine_date.#key]
RESIDENT temp_missing_records2
WHERE NOT EXISTS([machine_date.#key],[machine_date_conc.#key]);

DROP TABLE temp_missing_records2;

DROP FIELD [machine_date_conc.#key];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 08:30:05 GMT</pubDate>
    <dc:creator>RsQK</dc:creator>
    <dc:date>2022-07-14T08:30:05Z</dc:date>
    <item>
      <title>Count Missing Utilization</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955534#M78789</link>
      <description>&lt;P&gt;I have&amp;nbsp; a data source with item utilization. There is an machine #, date,&amp;nbsp;begin time, and end time. I have two different scenarios and ideally I need a total of "missing utilization" ....&amp;nbsp; A) begin time and end time are the same and B) no data exists at all for a date (meaning a machine was never logged into at all).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can currently count the instances for scenario A, but I cannot count the instances for scenario B. I assume I'll also need to query a calendar table and then count the instances where no data exists for each item # (because conceivably the dates will exist in a 1:1 relationship), but I'm not really sure how to go about that, if it will even work, or if there is a better solution available.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate any insight!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 04:46:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955534#M78789</guid>
      <dc:creator>drew61199</dc:creator>
      <dc:date>2022-07-14T04:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count Missing Utilization</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955683#M78806</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;in load statement you can use isnull() on the field mapping to the date field. if there is null then return a flag, use the count of that flag in the UI.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 08:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955683#M78806</guid>
      <dc:creator>Jobson_joseph</dc:creator>
      <dc:date>2022-07-14T08:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count Missing Utilization</title>
      <link>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955690#M78807</link>
      <description>&lt;P&gt;Hi, you can create a flag and use it in set analysis like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;temp:
LOAD
machine_number,
date,
begin_time,
end_time,
FABS(MATCH(begin_time,end_time)) AS missing_utilization_flag
INLINE [
machine_number,date,begin_time,end_time
A123,01.07.2022,00:24:00,00:30:00
A123,02.07.2022,01:24:00,01:30:00
A123,03.07.2022,02:24:00,02:30:00
A123,04.07.2022,00:24:00,00:24:00
A123,05.07.2022,03:24:00,03:30:00
A123,06.07.2022,04:24:00,04:30:00
A123,07.07.2022,05:24:00,05:30:00
A123,08.07.2022,05:24:00,04:30:00
A123,09.07.2022,07:24:00,07:30:00
A123,10.07.2022,08:24:00,08:30:00
B123,03.07.2022,02:24:00,02:30:00
B123,04.07.2022,00:24:00,00:24:00
B123,05.07.2022,03:24:00,03:30:00
C123,05.07.2022,03:24:00,03:30:00
C123,06.07.2022,01:24:00,17:30:00
C123,07.07.2022,05:24:00,05:30:00
C123,08.07.2022,06:24:00,06:30:00
C123,09.07.2022,07:24:00,07:30:00
];

temp_key:
LOAD DISTINCT
machine_number,
date
RESIDENT temp;

LEFT JOIN (temp)
LOAD *,
machine_number &amp;amp; '|' &amp;amp; NUM(date) as machine_date.#key
RESIDENT temp_key;

DROP TABLE temp_key;

temp_missing_records:
LOAD
NUM(FIELDVALUE('date',RECNO())) AS date
AUTOGENERATE FIELDVALUECOUNT('date');

JOIN (temp_missing_records)
LOAD
FIELDVALUE('machine_number',RECNO()) AS machine_number
AUTOGENERATE FIELDVALUECOUNT('machine_number');

INNER JOIN (temp_missing_records)
LOAD
1 AS missing_utilization_flag
AUTOGENERATE 1;

temp_missing_records2:
LOAD
machine_number &amp;amp; '|' &amp;amp; NUM(date) as machine_date_conc.#key,
date,
machine_number,
missing_utilization_flag
RESIDENT temp_missing_records;

DROP TABLE temp_missing_records;

CONCATENATE (temp)
LOAD *,
machine_date_conc.#key as [machine_date.#key]
RESIDENT temp_missing_records2
WHERE NOT EXISTS([machine_date.#key],[machine_date_conc.#key]);

DROP TABLE temp_missing_records2;

DROP FIELD [machine_date_conc.#key];&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 08:30:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-Missing-Utilization/m-p/1955690#M78807</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2022-07-14T08:30:05Z</dc:date>
    </item>
  </channel>
</rss>

