Question

Finding missing value from a range of dataset

  • 22 October 2021
  • 2 replies
  • 13 views

Badge

So I got a dataset, floorID and Unit Number. Here is what I want to do.

 

 

For each of the floorID (meaning each floor), the unit number should start from 0001 to the max number in sequence. For instance, in my example, there are 4 floor ID "level1", the unit should be 0001-0004. In contrast, there are 3 floor ID "level2", so the unit should be 0001-0003.

 

In my case, the input of floorID and unit number is unknown. But I want to find out the missing unit numbers or wrong input unit numbers.

 

Could someone guide me how to work in this case?

 

I have attached the correct and wrong output in here.

 

Oh, also, I have another question. This is the sample of the data

1-1, 1-2, 1-3

2-1, 2-2

If I want to see if the incoming input is within this value, might I ask what kind of transformer should I use? Do I need to input these values manually?

 

Thank you very much and sorry for all the questions.

 

Zach

 


2 replies

Userlevel 4
Badge +26

For your first question you can use lists to check this, you can start with an Aggregator first squash the each level into a single feature (Group by Floor ID). In the aggregator be sure to add the Unit number as a list attribute, here you can also get the number of floor features as an attribute.

Next you can sort the list (numerically) so that you have your max unit number as the last element in the list. You can use a list duplicate remover to ensure you have no duplicate unit numbers.

Next you can use a ListIndexer to extract the last index in the list (-1). This last index should match the number of units. Use can use a Tester to perform Numeric type tests, this means it will ignore the leading 0's in the Unit Numbers. Here's a screen shot of an example.

image

Badge

thank you very much! I will try it later. :)

Reply