Forecasting
Multiplying Two Interval Series in MetrixLT
“Help” was the desperate cry of a MetrixLT user after the close of the workday.
“I need to multiply two hourly interval data series in MetrixLT!” While the user understood the action can be accomplished in MetrixND or Excel, he didn’t want to leave the MetrixLT environment. After all, who wants to export data to a separate environment, perform a simple calculation, then re-import data back to MetrixLT?
MetrixLT was designed to perform complex functions such as scaling interval data to monthly data. For instance, an hourly profile (interval data) can easily be scaled to a monthly energy forecast (monthly data) in the Batch Transformation object. But, MetrixLT was not designed to address this user’s urgent need.
With flashbacks to the Apollo 13 movie scene of NASA engineers fitting a square air filter into a round hole, we went to work searching for a way to make MetrixLT perform a task that was not originally intended.
By leaving the Energy field empty, the Batch Transformation will not perform scaling resulting in Shape field values multiplying with the Loss Multiplier field values.
I’ve highlighted the validation for January 11, 2015.
Zone 1 values are now multiplied by Zone 2 values and stored in a Batch Transformation variable.
And that is how we fit a square air filter into a round hole.
“I need to multiply two hourly interval data series in MetrixLT!” While the user understood the action can be accomplished in MetrixND or Excel, he didn’t want to leave the MetrixLT environment. After all, who wants to export data to a separate environment, perform a simple calculation, then re-import data back to MetrixLT?
MetrixLT was designed to perform complex functions such as scaling interval data to monthly data. For instance, an hourly profile (interval data) can easily be scaled to a monthly energy forecast (monthly data) in the Batch Transformation object. But, MetrixLT was not designed to address this user’s urgent need.
With flashbacks to the Apollo 13 movie scene of NASA engineers fitting a square air filter into a round hole, we went to work searching for a way to make MetrixLT perform a task that was not originally intended.
Step 1: Import Interval Data
Use the Import Interval Data feature to create two hourly Data Tables in MetrixLT. In the example below, data for Zone1 and Zone2 are imported into MetrixLT. I’ve highlighted the January 11, 2015 values to check our work.Step 2: Configure A Batch Transformation
Create a Batch Transformation and configure the Shape and Loss Multiplier boxes with the Zone1 and Zone2 interval data. In the example, Zone1 interval data is placed in the Shape box and Zone2 interval data is placed in the Loss Multiplier box.By leaving the Energy field empty, the Batch Transformation will not perform scaling resulting in Shape field values multiplying with the Loss Multiplier field values.
Step 3: Calculate the Result
Select the “!” to calculate the Batch Transformation result and you are finished.I’ve highlighted the validation for January 11, 2015.
- Zone 1 = 2.60
- Zone 2 = 36.595
- Product = (Zone 1) x (Zone 2) = 95.147
Zone 1 values are now multiplied by Zone 2 values and stored in a Batch Transformation variable.
And that is how we fit a square air filter into a round hole.
Si è verificato un errore nell'elaborarazione del modello.
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>