How to define a code by comparing two attributes? (is it possible?) (SemQL or Plug_In)
R
Régis L'HOSTIS
started a topic
3 months ago
Hello,
I come to you because we cannot obtain the result we want to enrich an attribute in semarchy.
Our wish is to be able to define a code “S” or “E” in an attribute “Code Etab”.
To do this, we must define it by comparing 2 attributes (Ex: A and B) that we import into semarchy that we want to compare with a table that contains the data of the attributes to compare.
In other words, the result we expect must be the following:
The data from the imported source “A” = The data from the table with the attributes in semarchy “A”
AND
The data from the imported source “B” = The data from the table with the attributes in semarchy “B”
THEN (If the values of A and B are similar)
In this case the “Code Etab” will be equal to “S”.
ELSE
The “Code Etab” will be equal to “E”.
Method 1:
We first tried to obtain this result with a SemQL enricher with the following code:
CASE
WHEN A_SRC_ID = VLT_SIEGES_SOCIAUX.A_SS_SOURCE_ID
AND B_PUB_ID = VLT_SIEGES_SOCIAUX.B_SS_PUBID
THEN 'S'
ELSE 'E'
END
The function works, but systematically returns the value “E”. The correspondence between the imported data and the table with the data does not seem to be done. But we have doubts about whether it works this way…
Method 2:
We understood that we could obtain the result we want by using an enrichment of the “Semarchy Lookup enricher” type.
Does this seem coherent to you?
If so, could you give us some configuration ideas based on our needs. Despite our research we have not found how to configure this type of enrichment in the documentation (in Custom SQL?) - Do you have any concrete examples of configuring this type of enricher.
Régis L'HOSTIS
Hello,
I come to you because we cannot obtain the result we want to enrich an attribute in semarchy.
Our wish is to be able to define a code “S” or “E” in an attribute “Code Etab”.
To do this, we must define it by comparing 2 attributes (Ex: A and B) that we import into semarchy that we want to compare with a table that contains the data of the attributes to compare.
In other words, the result we expect must be the following:
The data from the imported source “A” = The data from the table with the attributes in semarchy “A”
AND
The data from the imported source “B” = The data from the table with the attributes in semarchy “B”
THEN (If the values of A and B are similar)
In this case the “Code Etab” will be equal to “S”.
ELSE
The “Code Etab” will be equal to “E”.
Method 1:
We first tried to obtain this result with a SemQL enricher with the following code:
CASE
WHEN A_SRC_ID = VLT_SIEGES_SOCIAUX.A_SS_SOURCE_ID
AND B_PUB_ID = VLT_SIEGES_SOCIAUX.B_SS_PUBID
THEN 'S'
ELSE 'E'
END
The function works, but systematically returns the value “E”. The correspondence between the imported data and the table with the data does not seem to be done. But we have doubts about whether it works this way…
Method 2:
We understood that we could obtain the result we want by using an enrichment of the “Semarchy Lookup enricher” type.
Does this seem coherent to you?
If so, could you give us some configuration ideas based on our needs. Despite our research we have not found how to configure this type of enrichment in the documentation (in Custom SQL?) - Do you have any concrete examples of configuring this type of enricher.
Thanks in advance for your help.