Hi there,
I have the code below in a docs.js file in Dataform includes folder. However, it seems not working after execution. eg. I used 3 docts notation before dims.session_date. Is it correct way to use in Dataform? Thanks in advance.
const dims = {
post_id:`page post id`,
page_title: `page title`,
page_path: `page path`,
...
}
const metrics = {
word_count: `total # of word count`,
pageviews: `total # of pageviews`,
article_pageviews: `total # of article pageviews`,
...
}
const fields_ga3_daily_article_performance = {
...dims.session_date,
...dims.post_id,
...dims.premium_status,
...dims.session_status,
...dims.channel_group,
...metrics.pageviews,
...
}
const fields_ga3_daily_channel_performance = {
...dims.session_date,
...dims.channel,
...dims.channel_group,
...dims.session_status,
...
}
module.exports = {
dims,
metrics,
fields_ga3_daily_article_performance,
fields_ga3_daily_channel_performance,
...
}
This is how i use in SQLX models
config {
name: "table1"
columns: docs.fields_ga3_article_performance
...
}
select ...
config {
name: "table2"
columns: docs.fields_ga3_channel_performance
...
}
select ...
I’ve done the same for table descriptions too and it doesn’t make any change in BQ table. Hope you can give me some ideas.
config{
description:table_definitions.daily_article_performance_table_desc,
}
const source_table_desc = "GA3 master source table";
const daily_article_performance_table_desc = "This table contains aggregated GA3 daily article performance data";