Skip to main content
Solved

Update attribute value based on lockup value

  • June 26, 2018
  • 2 replies
  • 21 views

boubcher
Contributor
Forum|alt.badge.img+11

Hello There

we are looking to update a table with the new attribute called layer the value will be populated by searching a keyword into the attribute ( Type ) that should contain the keyword in the lookup table

there is w way to do it by using the conditional value on the attribute value and writing all the key word there, but this will be a long task and not simple to maintain. since data is so big

we are looking to use the existing excel to maintain the lockup and then search only the keyword into the value of the attribute

Any suggestions?

Table

Dig_lcn Type Status 125 Electric network open 126 New Phone line open 127 sewer conduite intalation closed 128 Mv electric ntework closed 129 sewer renwell conduct open

if the attribute value containe the keyword in the lockup table

Lockup ID layer 1 Electric 2 Phone 3 sewer

then we get this Final result

Dig_lcn Type Status ID Layer 125 Electric network open 1 Electric 126 New Phone line open 2 Phone 127 sewer conduite intalation closed 3 sewer 128 Mv electric ntework closed 1 Electric 129 sewer renwell conduct closed 3 sewer

Best answer by takashi

Hi @boubcher, a possible way is, split the Type string into individual keywords and save them into a list attribute (AttributeSplitter), explode the list (ListExploder), then merge the look up table (FeatureMerger), as in:

0684Q00000ArJYTQA3.png

Alternatively, the InlineQuerier with this SQL statement can also be used.

select a.*, b.*
from "source" as a inner join "lookup" as b
on ' '||a."Type"||' ' like '% '||b.layer||' %'
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7842 replies
  • Best Answer
  • June 26, 2018

Hi @boubcher, a possible way is, split the Type string into individual keywords and save them into a list attribute (AttributeSplitter), explode the list (ListExploder), then merge the look up table (FeatureMerger), as in:

0684Q00000ArJYTQA3.png

Alternatively, the InlineQuerier with this SQL statement can also be used.

select a.*, b.*
from "source" as a inner join "lookup" as b
on ' '||a."Type"||' ' like '% '||b.layer||' %'

boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 212 replies
  • June 27, 2018

Hi @boubcher, a possible way is, split the Type string into individual keywords and save them into a list attribute (AttributeSplitter), explode the list (ListExploder), then merge the look up table (FeatureMerger), as in:

0684Q00000ArJYTQA3.png

Alternatively, the InlineQuerier with this SQL statement can also be used.

select a.*, b.*
from "source" as a inner join "lookup" as b
on ' '||a."Type"||' ' like '% '||b.layer||' %'

 

@takachi

 

you are the best