Skip to main content
Question

Can we use reference data in case statement in Computed content?


Forum|alt.badge.img

Can we add reference data in case statement in Computed content?

anna.spakova
Ataccamer
Forum|alt.badge.img+3

Hi โ€‹@sumisha ,

 

can you please elaborate a bit more on your usecase? The computed content is limited to the content of the mmm database, which means that it can only work with the metadata inside.

Kind regards,

Anna


Forum|alt.badge.img
  • Data Pioneer
  • April 14, 2025

HI Anna, I have a table defined in One data 

 

I want to use this in my case statement in Context to get value in attribute field. LIke where sensitivity is PII, mark as confidential. List is very long, so I don;t want to hard code in case. Rather use this One data table or any other reference table here

 


Forum|alt.badge.img
  • Data Pioneer
  • April 14, 2025

My computed content looks like this: 

 

 with
    connection_query as 
   (select att.$attId$   as term_instance_id,
                      ti.$tiFrom$ as "term_instance_from",
                      t.$tName$   as "displayName",
                      att.$attPath$ as "tiPath"
               from $att$ att
               inner join $ti$ ti on  att.$attId$ = ti.$tiParentId$
               inner join $t$ t on ti.target_ri = t.$tId$ and
                                         (ti.target_rh is null or ti.target_rh = t.to_h)
                        join "_MmdDictionary" d on ti.$tiPath$ = d.id and d.name like '%/termInstances')
select j.term_instance_id as "id_i",
       j.term_instance_from as "from_h",
       $path("tiPath")$ as "path_i",
       $type()$ as "type_i",
       j.term_instance_id as "parent_id_i",

 case 
           when j."displayName"='DateOfBirth' then 'PII'
           when j."displayName"='EmailAddress'  then 'PII'
           when j."displayName"='FirstName'  then 'PII'
           when j."displayName"='Mobile' then 'PII'
           when j."displayName"='Landline' then 'PII'
           else ''
           end as "sensitivity",
         case 
           when j."displayName"='DateOfBirth' then '4 - High'
           when j."displayName"='EmailAddress'  then '4 - High'
           when j."displayName"='FirstName'  then '4 - High'
           when j."displayName"='Mobile' then '4 - High'
           when j."displayName"='Landline' then '4 - High'
           else ''
           end as "risk"
from connection_query j


anna.spakova
Ataccamer
Forum|alt.badge.img+3

Hi โ€‹@sumisha ,

I understand your usecase, but this isnโ€™t supported to my knowledge. ONE Data is a completely different module that is separated from the mmm backend database, thus it cannot see its values. I am thinking that maybe the Lists of values could be able to help you here instead of ONE Data but that has very limited functionality (no DQ monitoring etc.)

Also an alternative solution could be to use the orchestration server for this automation - you can export the ONE Data reference data into some DB and use this export in your workflow, that would populate the field via API. Together with some Notification handler you could potentially be able to make it โ€œnear real timeโ€ as well.

https://docs.ataccama.com/runtime-server/latest/workflow-and-scheduler/notifications-handler.html

Kind regards,

Anna


Forum|alt.badge.img
  • Data Pioneer
  • April 14, 2025

Thanks for getting back. Can you share some screen shot of an example of List of values mentioned in first solution?


anna.spakova
Ataccamer
Forum|alt.badge.img+3

Hi, apologies for the delay.

The Lists of values are covered by our documentation: https://docs.ataccama.com/one/15.1.0/metadata-model/lists-of-values.html Itโ€™s basically just a space from which you can add new values to your custom entities - the main goal for those is to serve as small lookups for drop-down properties in other entities. But you can have multiple properties in those value list entities and you can also populate them via API. In general, you can use any custom entity for a drop-down, this is just a pre-built example of how it can be done.

Since those lists are entities within the metadata model, they are reachable by the computed content.

Kind regards,

Anna


Reply


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