• To Search the Seeq Knowledgebase:

# Search the Community

Showing results for tags 'setproperty()'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• Community Technical Forums
• General Seeq Discussions
• Training Resources
• Product Suggestions
• Seeq Data Lab
• Community News
• Seeq Blog Posts
• News Articles
• Press Releases
• Upcoming Events
• Resources

### Calendars

• Community Calendar

### Categories

• Seeq FAQs
• Online Manual
• General Information

• Published
• Code
• Media

• 0 Replies

• 0 Reviews

• 0 Views

Found 3 results

1. ## Aggregation with multiple signals in histogram

While Seeq is working towards enhancing our features in the Histogram tool, here are a simple workaround commonly used to create a histogram for multiple signals with display times in chronological order. Step 1: Start by loading all of the signals we want to include in the matrix into the display. Step 2: Create a monthly condition with a property that split the years and months (YYYY-MM) from the initial date format (YYYY-MM-DDT00:00:00Z) using the formula tool. Formula 1 - month_withProperty \$monthly = months("Asia/Kuala_Lumpur") //split the years and month of the data \$monthly .move(8hrs) //move based on specific timezone example the timezone used here is UTC+8 .transform(\$capsule -> \$capsule.setProperty('month_year',\$capsule.property('start').tostring().replace('/(.*)(-..T.*)/','\$1'))) Step 3: Combine the aggregate calculation for the multiple signals in a formula. Formula 2 -combine the aggregate calculations, example here is based on average. //Step 1: calculate monthly average for each signals \$monthlyaverageA = \$t1.aggregate(average(),\$month_withProperty, startKey(),0s) \$monthlyaverageB = \$t2.aggregate(average(),\$month_withProperty, startKey(),0s) \$monthlyaverageC = \$t3.aggregate(average(),\$month_withProperty, startKey(),0s) //Step2: combine all the discrete points and move each signal by 1,2 and 3 hours to have different time stamp. Please refer combinewith() formula documentation. combinewith( \$monthlyaverageA.move(1hr), \$monthlyaverageB.move(2hr), \$monthlyaverageC.move(3hr)) Step 4 : Create condition for each average temperature signals and use setProperty() function to set the naming for each signal. //Step 1: calculate monthly average for each signals \$monthlyaverageA = \$t1.aggregate(average(), \$month_withProperty, startKey(),0s) \$monthlyaverageB = \$t2.aggregate(average(), \$month_withProperty, startKey(),0s) \$monthlyaverageC = \$t3.aggregate(average(), \$month_withProperty, startKey(),0s) //Step2: combine all and create condition for each discrete points and set the property accordingly. combinewith( \$monthlyaverageA.move(1hr).toCapsules().setProperty('Mode','Area A'), \$monthlyaverageB.move(2hr).toCapsules().setProperty('Mode','Area B'), \$monthlyaverageC.move(3hr).toCapsules().setProperty('Mode','Area C')) Step 5: Create the histogram as shown in the screenshot below. The colour for each signal can be changed by selecting the legend box on the top right side of the histogram. For users who would like to split the quarter_year or year_week, please refer to the formula below. Formula to split quarter_year \$quarter = quarters(Month.January, 1, "Asia/Kuala_Lumpur") \$quarter.move(8hrs)//move based on specific timezone, example used here is UTC+8 .transform(\$cap -> { \$year = \$cap.startKey().toString().replace('/-.*/','') \$quart = \$cap.property('Quarter').toString() \$cap.setproperty('Quart',\$year+' '+'Q'+\$quart)}) Formula to split year_week //Set up formula for \$week_counter = (timesince(years("UTC"),1wk)+1).round() //The aim is to add '0' in front of single digit number so that the sequence in histogram 01, 02,....10, \$weekLessThan10 = \$week_counter < 10 \$signal1 = \$week_counter.toString() \$signal2 = toString('0').toSignal() + \$signal1 \$new_week_counter = \$signal1.splice(\$signal2,\$weekLessThan10 ) \$weekly_capsule_embedded_property = \$new_week_counter.toCondition() //Setting the year and week property //\$year - the function here meant to extract the year //\$week - the embedded Value is XX.0wk - remove the .0wk //set new property of year_week \$weekly_capsule_embedded_property.removeLongerThan(8d).transform(\$cap -> { \$year = \$cap.startKey().toString().replace('/-.*/','') \$week = \$cap.property('Value').toString().replace('/\wk/','') \$cap.setproperty('Year_Week',\$year+' '+'W'+\$week)}) You can also check this post to create histogram with hourly bins.
2. ## Creating Histograms with Multiple Groupings

FAQ: We have various conditions that are calculated from signals on a variety of different equipment and assets. We would like to view them in a histogram that is broken out by month, and for each month each asset has a separate bar in the histogram. Example Solution: 1. For three signals, we want to create a histogram that is the total time per month spent above some threshold. In this example, each signal is associated with a different cooling tower Area. 2. We have a condition for when each signal is above it's threshold value. These conditions were created using the value search tool. 3. The three conditions can be combined into a single condition (here it is called "Combined In High Mode w Area as Property"). In the formula tool, before combining the conditions, we assign each condition a property called 'Area' and set the value as that particular asset area. Once the properties are set we use the combineWith() function to combine them into one final signal. The formula syntax below will achieve this: //Create a new condition for each original condition that has a property of 'Area'. \$A=\$AHigh.setProperty('Area','Area A') \$G=\$GHigh.setProperty('Area','Area G') \$I=\$IHigh.setProperty('Area','Area I') //Combine the new conditions created into a new condition with all of the high power modes where each capsule //has a property of 'Area' that describes the signal that was searched to identify that original condition. combineWith(\$A,\$G,\$I) ***Note: the combineWith() function in Seeq Formula is required here because it will retain capsule properties of individual conditions when combining them. Using union() or any other composite condition type logic will NOT retain the capsule properties of the individual condition.*** 4. Use the Histogram tool and the multiple grouping functionalities to aggregate over both time, and the capsule property of 'Area'. Final Result: (remove other items from the details pane to view just the histogram)