Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajakumaranakash
Contributor II
Contributor II

How to identify the difference in the table through measures

I have table with available server information with date. I want to identify the missing and added server by comparing two dates. 

My Data:

Report date Server
8/28/2023 Server1
8/28/2023 Server2
8/28/2023 Server3
8/28/2023 Server4
8/28/2023 Server5
8/21/2023 Server1
8/21/2023 Server2
8/21/2023 Server3
8/21/2023 Server5
8/21/2023 Server6
8/21/2023 Server7
8/14/2023 Server1
8/14/2023 Server2
8/14/2023 Server3
8/14/2023 Server4

 

Expected 2 outputs: If I select 2023-08-28 and 2023-08-14 I should get below output.

Table 1: Missing Server from old date

Report date Missing Server
8/21/2023 Server6
8/21/2023 Server7

 

Table 2: Newly added Server

Report date Added Server
8/21/2023 Server4

 

I could not modify my script. So I would like to do this with expression

I hope some one can help me with this

Labels (1)
1 Solution

Accepted Solutions
Javizh
Partner - Contributor III
Partner - Contributor III

Hello.

You can get this adding a metric to the tables, counting the servers that fullfil the condition.

For the newly added (Date is max date)

  • Count(distinct {<[Server] = {"= [Report date] = '$(=date(max([Report date])))'"}>} Server)

For the missing (Date is min date)

  • Count(distinct {<[Server] = {"= [Report date] = '$(=date(min([Report date])))'"}>} Server)

This will only work if you select only the 2 dates you want to compare.

Attached is an example.

Best regards.

View solution in original post

2 Replies
Javizh
Partner - Contributor III
Partner - Contributor III

Hello.

You can get this adding a metric to the tables, counting the servers that fullfil the condition.

For the newly added (Date is max date)

  • Count(distinct {<[Server] = {"= [Report date] = '$(=date(max([Report date])))'"}>} Server)

For the missing (Date is min date)

  • Count(distinct {<[Server] = {"= [Report date] = '$(=date(min([Report date])))'"}>} Server)

This will only work if you select only the 2 dates you want to compare.

Attached is an example.

Best regards.

Rajakumaranakash
Contributor II
Contributor II
Author

Thank you @Javizh  This worked well.