Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/07/2021 in all areas

  1. 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.
    1 point
  2. Hi Prachi, A couple different options for you: Option 1 You're probably familiar that you can use Formula (or Value Search) with the following to create a capsule for when one signal is equal to 1: $signal==1 Therefore, one option is to combine this search together for each signal using the combinewith function: combinewith($signal1==1, $signal2==1, ... , $signal50==1) This will create a capsule for each signal equal to 1, which would result in multiple overlapped capsules if more than one signal was equal to 1. If you'd like to reduce that to create a capsule if "any" signal was 1, you could merge those together: combinewith($signal1==1, $signal2==1, ... , $signal50==1).merge() Alternately, if you want to know how many signals are equal to 1 at any point in time, you can use countoverlaps: combinewith($signal1==1, $signal2==1, ... , $signal50==1).countoverlaps() Option 2 Typically when counting 1 values, the signals are a 0/1 signal where it is 0 when inactive and 1 when active. If this is the case in your use case, an alternate approach could be to sum the signals and find when it is greater than or equal to 1: sum($signal1, $signal2, ... , $signal50) >= 1
    1 point
  3. Sometimes when looking at an xy plot, it can be helpful to use lines to designate regions of the chart that you'd like users to focus on. In this example, we want to draw a rectangle on the xy plot showing the ideal region of operation, like below. We can do this utilizing Seeq's ability to display formulas overlaid against an xy plot. 1. For this first step, we will create a ~horizontal line on the scatter plot at y=65. This can be achieved using a y=mx+b formula with a very small slope, and a y-intercept of 65. The equation for this "horizontal" line on the xy plot is: 0.00001*$x+65 2. If we want to restrict the line to only the segment making the bottom of our ideal operation box, we can leverage the within function in formula to clip the line at values we specify. Here we add to the original formula to only include values of the line between x=55 and 5=60. (0.00001*$x+65) .within($x>55 and $x<60) 3. Now let's make the left side of the box. A similar concept can be applied to create a vertical line, only a very large positive or negative slope can be used. For our "vertical" line at x=55, we can use the following formula. Note some adjustment of the y-axis scale may be required after this step. (-10000*($x-55)) 4. To clip a line into a line segment by restricting the y values, you can use the max and min functions in Formula, combined with the within function. The following formula is used to achieve the left side boundary on our box: (-10000*($x-55)) .max(65) .min(85) .within($x<55.01 and $x>54.99) The same techniques from steps 1-4 could be used to create the temperature and wet bulb max boundaries. Formula for max temp boundary: (0.00001*$x+85).within($x>55 and $x<60) Formula for max wet bulb boundary: (-10000*($x-60)) .max(65) .min(85) .within($x<60.01 and $x>59.99)
    1 point
This leaderboard is set to Los Angeles/GMT-07:00
×
×
  • Create New...