Forecasting
Using In-Line Transformation in the Report Object
I’m developing a forecast that requires base, high, and low scenarios. After building the base scenario, the high and low scenarios are created by duplicating the base scenario process, changing the tables names from “Base” to “High” or “Low” and updating the equations. The result is a structure where the variable names are identical, but the table names indicated the scenario as shown below.
Using this structure, I build a Report Object that exports the Residential Sales variables for comparison in a summary MetrixND file. I create the Report object by dragging and dropping the variables into a single Report. The comparison Report of the Residential sales is shown below.
I like to import the Report into a second MetrixND project file so I can develop comparison graphs and objects. Using a second MetrixND project file helps me reduce the clutter of my project files pushing diagnostic and summary information away from my primary forecast models and variable development.
The problem is that the Report cannot be imported into a second MetrixND project file. When I attempt to import the table, I get the following error because the three variables are named “Residential”. The import process does not recognize that the variables come from different tables.
To solve the problem, I use the “In-Line” transformation in the Report Object. In the Report Object, “right-mouse-click” to bring up the “Insert Inline Transform” option.
Selecting this option initiates the “Edit Transform” dialogue box. To obtain the same results as before, I define a unique name (e.g. High) and set the formula to equal the High Residential sales variable.
Replicating the process three time (i.e. for High, Base, and Low), I construct the same Report Object as before, but I now have unique names for the Residential forecast values.
This Report can now be imported into a second MetrixND project file or the new Forecast Manager system. The In-line transform feature of the Report Object is a useful to rename variables, create equations, or summarize results prior to exporting the data. The ability to create new names makes the report a powerful tool for connecting a MetrixND project file to MetrixLT or Forecast Manager.
Using this structure, I build a Report Object that exports the Residential Sales variables for comparison in a summary MetrixND file. I create the Report object by dragging and dropping the variables into a single Report. The comparison Report of the Residential sales is shown below.
I like to import the Report into a second MetrixND project file so I can develop comparison graphs and objects. Using a second MetrixND project file helps me reduce the clutter of my project files pushing diagnostic and summary information away from my primary forecast models and variable development.
The problem is that the Report cannot be imported into a second MetrixND project file. When I attempt to import the table, I get the following error because the three variables are named “Residential”. The import process does not recognize that the variables come from different tables.
To solve the problem, I use the “In-Line” transformation in the Report Object. In the Report Object, “right-mouse-click” to bring up the “Insert Inline Transform” option.
Selecting this option initiates the “Edit Transform” dialogue box. To obtain the same results as before, I define a unique name (e.g. High) and set the formula to equal the High Residential sales variable.
Replicating the process three time (i.e. for High, Base, and Low), I construct the same Report Object as before, but I now have unique names for the Residential forecast values.
This Report can now be imported into a second MetrixND project file or the new Forecast Manager system. The In-line transform feature of the Report Object is a useful to rename variables, create equations, or summarize results prior to exporting the data. The ability to create new names makes the report a powerful tool for connecting a MetrixND project file to MetrixLT or Forecast Manager.
Kesalahan terjadi ketika Memproses Template.
The following has evaluated to null or missing:
==> authorContent.contentFields [in template "44616#44647#114455" at line 9, column 17]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: contentFields = authorContent.content... [in template "44616#44647#114455" at line 9, column 1]
----
1<#assign
2 webContentData = jsonFactoryUtil.createJSONObject(author.getData())
3 classPK = webContentData.classPK
4/>
5
6<#assign
7authorContent = restClient.get("/headless-delivery/v1.0/structured-contents/" + classPK + "?fields=contentFields%2CfriendlyUrlPath%2CtaxonomyCategoryBriefs")
8contentFields = authorContent.contentFields
9categories=authorContent.taxonomyCategoryBriefs
10authorContentData = jsonFactoryUtil.createJSONObject(authorContent)
11friendlyURL = authorContentData.friendlyUrlPath
12authorCategoryId = "0"
13/>
14
15<#list contentFields as contentField >
16 <#assign
17 contentFieldData = jsonFactoryUtil.createJSONObject(contentField)
18 name = contentField.name
19 />
20 <#if name == 'authorImage'>
21 <#if (contentField.contentFieldValue.image)??>
22 <#assign authorImageURL = contentField.contentFieldValue.image.contentUrl />
23 </#if>
24 </#if>
25 <#if name == 'authorName'>
26 <#assign authorName = contentField.contentFieldValue.data />
27 <#list categories as category >
28 <#if authorName == category.taxonomyCategoryName>
29 <#assign authorCategoryId = category.taxonomyCategoryId />
30 </#if>
31 </#list>
32 </#if>
33 <#if name == 'authorDescription'>
34 <#assign authorDescription = contentField.contentFieldValue.data />
35
36 </#if>
37
38 <#if name == 'authorJobTitle'>
39 <#assign authorJobTitle = contentField.contentFieldValue.data />
40
41 </#if>
42
43</#list>
44
45<div class="blog-author-info">
46 <#if authorImageURL??>
47 <img class="blog-author-img" id="author-image" src="${authorImageURL}" alt="" />
48 </#if>
49 <#if authorName??>
50 <#if authorName != "">
51 <p class="blog-author-name">By <a id="author-detail-page" href="/w/${friendlyURL}?filter_category_552298=${authorCategoryId}"><span id="author-full-name">${authorName}</span></a></p>
52 <hr />
53 </#if>
54 </#if>
55 <#if authorJobTitle??>
56 <#if authorJobTitle != "">
57 <p class="blog-author-title" id="author-job-title" >${authorJobTitle}</p>
58 <hr />
59 </#if>
60 </#if>
61 <#if authorDescription??>
62 <#if authorDescription != "" && authorDescription != "null" >
63 <p class="blog-author-desc" id="author-job-desc">${authorDescription}</p>
64 <hr />
65 </#if>
66 </#if>
67</div>
The following has evaluated to null or missing: ==> authorContent.contentFields [in template "44616#44647#114455" at line 9, column 17] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: contentFields = authorContent.content... [in template "44616#44647#114455" at line 9, column 1] ----
1<#assign
2 webContentData = jsonFactoryUtil.createJSONObject(author.getData())
3 classPK = webContentData.classPK
4/>
5
6<#assign
7authorContent = restClient.get("/headless-delivery/v1.0/structured-contents/" + classPK + "?fields=contentFields%2CfriendlyUrlPath%2CtaxonomyCategoryBriefs")
8contentFields = authorContent.contentFields
9categories=authorContent.taxonomyCategoryBriefs
10authorContentData = jsonFactoryUtil.createJSONObject(authorContent)
11friendlyURL = authorContentData.friendlyUrlPath
12authorCategoryId = "0"
13/>
14
15<#list contentFields as contentField >
16 <#assign
17 contentFieldData = jsonFactoryUtil.createJSONObject(contentField)
18 name = contentField.name
19 />
20 <#if name == 'authorImage'>
21 <#if (contentField.contentFieldValue.image)??>
22 <#assign authorImageURL = contentField.contentFieldValue.image.contentUrl />
23 </#if>
24 </#if>
25 <#if name == 'authorName'>
26 <#assign authorName = contentField.contentFieldValue.data />
27 <#list categories as category >
28 <#if authorName == category.taxonomyCategoryName>
29 <#assign authorCategoryId = category.taxonomyCategoryId />
30 </#if>
31 </#list>
32 </#if>
33 <#if name == 'authorDescription'>
34 <#assign authorDescription = contentField.contentFieldValue.data />
35
36 </#if>
37
38 <#if name == 'authorJobTitle'>
39 <#assign authorJobTitle = contentField.contentFieldValue.data />
40
41 </#if>
42
43</#list>
44
45<div class="blog-author-info">
46 <#if authorImageURL??>
47 <img class="blog-author-img" id="author-image" src="${authorImageURL}" alt="" />
48 </#if>
49 <#if authorName??>
50 <#if authorName != "">
51 <p class="blog-author-name">By <a id="author-detail-page" href="/w/${friendlyURL}?filter_category_552298=${authorCategoryId}"><span id="author-full-name">${authorName}</span></a></p>
52 <hr />
53 </#if>
54 </#if>
55 <#if authorJobTitle??>
56 <#if authorJobTitle != "">
57 <p class="blog-author-title" id="author-job-title" >${authorJobTitle}</p>
58 <hr />
59 </#if>
60 </#if>
61 <#if authorDescription??>
62 <#if authorDescription != "" && authorDescription != "null" >
63 <p class="blog-author-desc" id="author-job-desc">${authorDescription}</p>
64 <hr />
65 </#if>
66 </#if>
67</div>