Question

Creating a NDT column by concatenating two fields

  • 4 October 2021
  • 2 replies
  • 23 views

Hello, 

I want to create a column in an NDT that concatenates two fields. 

 

view: ndt_sessions {
  derived_table: {
   explore_source: sessions {
      column: website_name {}
      column: partition_date {}
      column: id {}
}
}
}

I want to derive the column id{} from two fields fullvisitorid and visitid that are not in the table yet. 

 

Can I create the column id as a concatenation of the fields fullvisitorid and visitid without adding these two fields as columns in the table? Or do I have to bring those two into the table and then derive the id column?
    


2 replies

Thank you @olga for the clear explanation. 

Userlevel 1

Hiya!

Indeed, we need to have the columns already specified in order to be able t ouse them in the derived column. https://docs.looker.com/data-modeling/learning-lookml/creating-ndts#creating_derived_columns_for_calculated_values

The custom dimension functionality that can be used in the explore itself to derive a dimension from fields not selected, is not currently supported for the ndts (neither for aggregate tables).

So yes, you have to bring those two into the table and then derive the id column

Reply