Dashboard Widget Stream Formula Expressions221
Pages:
1
![]() |
MikeMills private msg quote post Address this user | |
We've added the ability to apply an expression to streams in dashboard widgets:![]() The variable value is the sample value within an expression. The expression is applied to the feed on the server during the stream feed request. Visual offsets and multipliers are still applied to the stream after the expression has already been applied on the server. Expressions can be applied to stream groups too. The calculation engine is the same engine that is used for derivation and event detection so the same library of operators and functions are available. Some Examples: value * 100 : Multiplies each data point times 100 if(isNull(value), 0, value) : Fill gaps with zero in the graph if (value > 100, 100, value) : Set a ceiling of 100 if (value > 100, 100, if (value < 0, 0, value)) : Set a floor of zero and a ceiling of 100 if (value > 100, NULL, value) : Set values above 100 to gaps. This will cause a line graph not to display the value if connect gaps is false. |
||
Post 1 IP flag post |
![]() |
xcguy private msg quote post Address this user | |
I'd like to have an expression that converts Boolean True/False to Open/Close. I tried: if (value, 'Open', 'Close') But that generates String can't be converted to Boolean error. Any ideas? |
||
Post 2 IP flag post |
![]() |
MikeMills private msg quote post Address this user | |
I think the issue is that the widget is expecting the result type to match the stream value type which is boolean. You could create a new derived String/Text stream as a workaround: - Copy the boolean stream within the component editor. * Change its value type to String/Text * Derive it, via formula expression, from the boolean stream. Set the expression to if (var1, 'Open', 'Close') - Use the copied stream in your widget |
||
Post 3 IP flag post |
![]() |
xcguy private msg quote post Address this user | |
Worked great, thanks for the tip. | ||
Post 4 IP flag post |
![]() |
MikeMills private msg quote post Address this user | |
Another solution is to just create a new Unit for the boolean stream that has its Boolean Format set to Close/Open.![]() |
||
Post 5 IP flag post |
![]() |
xcguy private msg quote post Address this user | |
Mike, I like this second suggestion -- using the new Boolean Format Close/Open. However, I need it flipped -- when a contact sensor is open, it's value is true, and when it's closed, it's false. Can you make a "Open/Close" type we can use for the Boolean Format? |
||
Post 6 IP flag post |
![]() |
MikeMills private msg quote post Address this user | |
@xcguy - Sure. Done. Do an F5 while within your Org's Observation Studio to refresh the GS java script files in your browser's cache. | ||
Post 7 IP flag post |
![]() |
xcguy private msg quote post Address this user | |
Perfect. Thank you! | ||
Post 8 IP flag post |
![]() |
runforfun7 private msg quote post Address this user | |
Is it possible to do an expression of value - yesterday's value? Trying see the amount of kWhs used each day without having to reset the value every day as I want to just reset that monthly. | ||
Post 9 IP flag post |
![]() |
MikeMills private msg quote post Address this user | |
@runforfun7 Not directly using a widget expression. I think what you want is already being done for you. All time rollups, including day and month SUMs are available for selection and viewing: From within the Stream Viewer. Double click a stream: ![]() From within a dashboard widget: ![]() If that doesn't answer your question, then a derived stream is probably the answer. Let us know either way. |
||
Post 10 IP flag post |
![]() |
runforfun7 private msg quote post Address this user | |
Got it to work in the stream viewer, but seem to be having issues with it as a widget. Cycle is set to Days and then picked sum. | ||
Post 11 IP flag post |
![]() |
MikeMills private msg quote post Address this user | |
@runforfun7 - What kind of issues? | ||
Post 12 IP flag post |
Pages:
1