Skip to main content
Solved

Test a value

  • December 13, 2021
  • 8 replies
  • 30 views

Forum|alt.badge.img

Hello there,

 

So I have two attributes: "Floor" and "Purpose".

 

Floor Purpose

1 Lobby

2 Restaurant

3 Swimming pool

 

So I want to verify the dataset. If the "Floor" is 1, "Purpose" must be lobby. May I ask what kind of transformer I should use?

 

Thank you very much.

Best answer by ebygomm

I'd probably use an AttributeValueMapper followed by a tester to save having to write a complicated conditional in the tester, especially if you have an external data source with the allowed values which can be imported into the AttributeValueMapper

 

So use the AttributeValueMapper to map the floor value to a new attribute called TestPurpose or similar, followed by a tester to check that TestPurpose = Purpose

image

View original
Did this help you find an answer to your question?

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+55

You can use a Tester to do this. One of the most used transformers.

Floor != 1 OR ( Floor = 1 AND Purpose = Lobby )

TesterParameters


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • Best Answer
  • December 13, 2021

I'd probably use an AttributeValueMapper followed by a tester to save having to write a complicated conditional in the tester, especially if you have an external data source with the allowed values which can be imported into the AttributeValueMapper

 

So use the AttributeValueMapper to map the floor value to a new attribute called TestPurpose or similar, followed by a tester to check that TestPurpose = Purpose

image


redgeographics
Celebrity
Forum|alt.badge.img+50
nielsgerrits wrote:

You can use a Tester to do this. One of the most used transformers.

Floor != 1 OR ( Floor = 1 AND Purpose = Lobby )

TesterParameters

I actually prefer the TestFilter over the Tester for the following reasons:

  • It allows you to perform multiple tests in a single transformer, rather than chaining mulitlple Testers in a row
  • It allows you to rename the output ports, which is a good idea with regards to Best Practices.

Forum|alt.badge.img

Thank you all for your help. Now my data it seems a little bit more complicated than I thought.

 

I have 3 data sets.

 

1) Floor (2 attribute = Floor & FloorID)

Floor = 1, 2, 3, 4, 5 ....

FloorID= a series of number

 

2) Units (2 attributes = FloorID & Carpark type)

FloorID = a series of number

Carpark type = 15-01, 15-02, 15-03, 16-01, 16-02, 17-01, 17-02 ....

 

3) Excel (Carpark group)

Carpark type: 15-01, 15-02, 15-03, 16-01, 16-02

 

Here is what I need to do.

1) Extract "Floor" data that are floor "5", with all the FloorID

2) Use the selected FloorID to find all the units that matched.

3) Compare selected data (Step 2) with the excel to check if it is in the range.

 

Thank you in advance.

 

Have a good day.

 


redgeographics
Celebrity
Forum|alt.badge.img+50
zacharylee1204 wrote:

Thank you all for your help. Now my data it seems a little bit more complicated than I thought.

 

I have 3 data sets.

 

1) Floor (2 attribute = Floor & FloorID)

Floor = 1, 2, 3, 4, 5 ....

FloorID= a series of number

 

2) Units (2 attributes = FloorID & Carpark type)

FloorID = a series of number

Carpark type = 15-01, 15-02, 15-03, 16-01, 16-02, 17-01, 17-02 ....

 

3) Excel (Carpark group)

Carpark type: 15-01, 15-02, 15-03, 16-01, 16-02

 

Here is what I need to do.

1) Extract "Floor" data that are floor "5", with all the FloorID

2) Use the selected FloorID to find all the units that matched.

3) Compare selected data (Step 2) with the excel to check if it is in the range.

 

Thank you in advance.

 

Have a good day.

 

First a TestFilter or Tester to select floor 5, then a FeatureMerger to join that to the Units. Then the Merged output from that into another FeatureMerger to join it to the Excel and see what's merged/unused.


Forum|alt.badge.img
redgeographics wrote:

First a TestFilter or Tester to select floor 5, then a FeatureMerger to join that to the Units. Then the Merged output from that into another FeatureMerger to join it to the Excel and see what's merged/unused.

Thank you very much.

So I still have a minor problem. I am able to merge the floor and unit.

 

Lets say

Floor Type (Unit)

1/F 1-01, 15-01, 15-02 ...

2/F 1-01 , 2-01 ...

 

On each floor, I am able to find all the types (Unit) and store those in the "list". If there are one type (unit) is matched with the excel list on each floor. Then it is ok. My final goal is to find out which floor that the types (unit) are not on the excel.

 

This image shows what I got so far. Do I need to use "ListExploder" to explode the list first?

 

Thank you

 

sample 


redgeographics
Celebrity
Forum|alt.badge.img+50
redgeographics wrote:

First a TestFilter or Tester to select floor 5, then a FeatureMerger to join that to the Units. Then the Merged output from that into another FeatureMerger to join it to the Excel and see what's merged/unused.

Yes, you'll need to explode that list to separate features if you want to use it in a FeatureMerger


Forum|alt.badge.img
redgeographics wrote:

First a TestFilter or Tester to select floor 5, then a FeatureMerger to join that to the Units. Then the Merged output from that into another FeatureMerger to join it to the Excel and see what's merged/unused.

Got it, thank you very much! Merry christmas and happy new year! :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings