Skip to main content
Solved

Creating a new table from the main database based on attributes


Hello,

I have a main table called "Documents". I need to create a table called "List" based on data from the "Documents" table. Within the "Documents" table, I have a column called "ElaborationType," and within it, the number 1 represents the main document. Numbers 6, 14, 33 represent documents related to the main document, i.e., they are lists. My goal is to generate results in the "List" table where the "RecordID" in that row matches the "ElaborationType" equal to 1, but it also repeats or duplicates that number based on the numbers 6, 14, 33.

(EXAMPLE: 2302(6), 2304(MAIN DOCUMENT NUMBER 1), 3177(14) belong to the same group because they are in the same cadastral municipality KO_ID).

Within the "List" table, I need to have 2304, 2304 because they are lists for the main document 2304, and they must have their corresponding year from the "FromYear" attribute.

Is it somehow possible to solve this problem using the FME Desktop program? I would be greatly thankful if you could provide assistance. I have provided you with an image of the main table as an example for you to see a sample of the data. I need to do this for the entire dataset; I described just one example, but in the image, you can see that I need to apply this process to the entire dataset.

example

Best answer by geomancer

Continuing my earlier answer given here:

You can add the results to the original features.

image

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

11 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

It's possible for sure, but to make it clearer, could you provide a similar example of what the lists table should look like for the records you indicated in red?


  • Author
  • August 26, 2023

In this example, you can see exactly what I need to achieve. I simply need to extract the lists from the documents and assign them the "RecordID"(ZapisID) that belongs to the main document number 1, as all these numbers, 6, 14, 33, are subordinate documents to that main one. The attribute "FromYear"(IzGodine) represents the year of data creation. This presents an issue for me because doing this manually would consume a significant amount of time.

exaple2


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • Best Answer
  • August 28, 2023

Continuing my earlier answer given here:

You can add the results to the original features.

image


  • Author
  • August 28, 2023

Thanks!


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • August 28, 2023

You're welcome!

P.S. There are many other possible approaches, like using Adjacent Feature Attributes, or an InlineQuerier, and more. But I think the solution presented above is the most simple to comprehend.


  • Author
  • August 28, 2023

I have a question, only if you could take a look. I've imported the entire data into FME with those steps. If you could check if I've done something wrong because it didn't arrange the data like you explained. Instead, the data remained the same. If you could verify, the file is attached, so if you could review and return the corrected file to me?


  • Author
  • August 28, 2023

Here are the initial data. Perhaps it's important to emphasize to make it clearer that some lists (6, 14, 33) are not associated with any main document (1), but generally, I need to obtain the result as you explained in your example.


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • August 28, 2023

Hi, thank you for the data. Unfortunately I could not open your workspace, as I still use an older version of FME. But I think I may have found the problem nonetheless. Can it be you did not change VrstaElabora to VrstaElaborateID in the TestFilter, or in one of the other transformers?

image


  • Author
  • August 28, 2023

I think I have a problem with the AttributeRemover transformer. It doesn't allow me to put in "ElaborationTypeID"; instead, it prompts me for something like a list. It's a bit strange; perhaps it's related to the version.12


geomancer
Evangelist
Forum|alt.badge.img+48
  • Evangelist
  • August 28, 2023

There are some differences in the attributes.

Attached please find my version of the workspace, can you try it?


  • Author
  • August 28, 2023

I have successfully obtained everything correctly now with your file, thank you, this has helped me a lot.


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