Skip to main content

Hi all,

I'm having a hard
time describing the issue I'm facing so I'll just show what output I need.

I need two
writers:

 

The first writer
contains POI_NAME and POI IDs. (unique values)

 

 

The second writer
should output the POI IDs found in the first writer but with two
additional attributes TYPE / TYPE_VALUE that can hold various strings.

 

(Basically I have no clue on how to populate POI_ID with identical values but TYPE / TYPE_VALUE with different values)

Reader:

First writer:

Second writer:

 

Thanks,

Ed

Hi.

 

 

Could you tell us a little bit about the source data? It would be easier to help you if we knew the schema of the information you are reading.

 

 


Hi.

 

 

Could you tell us a little bit about the source data? It would be easier to help you if we knew the schema of the information you are reading.

 

 

Hi @oscard ,

 

 

Thanks for the fast response. I can't show you the actual source data but it contains all data and the format looks like this:

 

 

 

 

In short the reader contains all data that needs to be written to two writers. Cheers,

 

Ed

An easy solution to get the second writer could be with two AttributeManager.

Join the reader with one of them:

- Keep POI_ID and SUBCAT.

- Create the attribute TYPE and give it the value "SUBCAT"

- Rename "SUBCAT" to "TYPE_VALUE"

Join the reader with the other one:

- Keep POI_ID and URL

- Create the attribute TYPE and give it the value "URL"

- Rename "URL" to "TYPE_VALUE"

Join both AttributeManagers with the second writer.

I think that should work.


An easy solution to get the second writer could be with two AttributeManager.

Join the reader with one of them:

- Keep POI_ID and SUBCAT.

- Create the attribute TYPE and give it the value "SUBCAT"

- Rename "SUBCAT" to "TYPE_VALUE"

Join the reader with the other one:

- Keep POI_ID and URL

- Create the attribute TYPE and give it the value "URL"

- Rename "URL" to "TYPE_VALUE"

Join both AttributeManagers with the second writer.

I think that should work.

Almost - but I'm getting duplicated values in the TYPE attribute... :-(

 

Did I do something wrong?

 


Almost - but I'm getting duplicated values in the TYPE attribute... :-(

 

Did I do something wrong?

 

I guess you mean you are getting empty values for POI_ID and TYPE_VALUE in some rows.

 

I bet the reader is reading empty rows. Add a Tester after the reader:

 

- If "POI_ID" has value --> Passed

 

- Otherwise --> Failed (do nothing with the elements of this port)

 

 


The empty values are not in the reader so I've put the tester just before the writer - it works now!

Thanks for your help and fast response.

Best,

Ed


The empty values are not in the reader so I've put the tester just before the writer - it works now!

Thanks for your help and fast response.

Best,

Ed

Glad to know you could resolve it :)

 

 


Reply