Jump to content

Nuraisyah Rosli

Seeq Team
  • Posts

    24
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Nuraisyah Rosli

  1. Hi Onkar,

    Our certificates doesn't include a credential ID just the certificate with the person's name on it. And for your 2nd question, upon checking with our training team, you have already completed all required courses within the path. The only way to have 100% completion is to take as well the other optional courses within the path, but it is not required. 

  2. Hi JC-XOM,

    You can extract the worksheet ID using Seeq API. Here's an example:

    workbooks_api = seeq.sdk.WorkbooksApi(spy._login.client) #calling the workbook API
    workbook_id = '0EEC3FB8-2D63-ECB0-86E9-47A0DC532F31' #replace the ID with your own workbook ID
    worksheets = workbooks_api.get_worksheets(workbook_id=workbook_id).to_dict()['worksheets'] #calling the worksheets under the workbook ID
    worksheets

    The start/end time will follow the existing worksheets.

  3. Question: My problem is that I can’t seem to make asset trees that have branches with different lengths using spy.assets.Tree(). This is frustrating because it means for (effectively) shorter branches I’ll have to click through several folders to get down to the folder with tags in it.

    Answer: Let say for Cooling Tower 2, you want the signals to be populated directly under Cooling Tower 2. If you leave the column ‘’Level 3’’ blank, you’ll get this error:

    image.png

    Instead, you want to insert NAN into the empty ‘’Level 3’’ column like this:

    image.png

     Hope this helps.

    • Like 1
  4. Ok, now I understand what you're trying to achieve. For this, you have to calculate the total duration separately and use Formula tool to manually calculate the Percent duration. 

    1. calculate total duration for purple capsule

    image.png

    2. calculate the total duration for daily condition

    image.png

    3. calculate the percent duration using Formula tool.

    image.png

    It should generate result like this where you have value for each capsules. 

    image.png

     

    Let me know if this answer your question.

  5. You can refer to my screenshot below, as you can see that the brown capsules encloses all the purple capsules but it will calculate the % of time purple capsules within the brown capsules .

    image.png

     

    My guess is maybe you put the purple capsules as bounding condition. In that case, yes it will give a 100% result as screenshot below:

    image.png

     

    Let me know if this helps or maybe you can share screenshots of your workbench for me to understand better. Alternatively, you can also join our Office Hour session where you can discuss directly with our Analytics Engineer.

  6. On 12/31/2023 at 8:19 AM, Philip said:

    Hi,

    I have a related question. Instead of the total duration of all the purple capsules within the filter replacement time range, suppose I want to know the % duration of Filter Time Range is does each purple capsule represent?

    Hi Phillip, 

    In that case you can select percent duration as summary statistic in you Signal from Condition tool. Choose the purple capsule as the first signal, and Filter time range as your bounding condition. 

  7. Hi Karol,

    Results of calculations (formula, value searches etc) will always be cached by Seeq so that is why you see it was not refreshed automatically when there's a rewrite in historian data. To refresh the output, you need to clear the cache. In Seeq workbench, you can click on the Item properties of the signal, scroll to the bottom under Advanced and click "Clear Cached Values".

    image.png

    Do you always rewrite your historian data? If yes, then maybe turning off the cache is a better option. You can read more about Data Caching here.

     

  8. Hi PMHardey,

    If I understand this correctly, you want to find the maximum value in every 15 minutes capsules over rolling 3 years period. If yes, this is how you can do it.

    Step 1 : Create the 15 minutes capsule using the formula tool. this will generate a capsule for every 15 minutes.

    periods(15mins)

    Step 2: Create a rolling 3 year periods using formula tool. this will create capsules with duration of 3 years every 1 year.

    periods(3y,1y)

    Step 3: calculate the max value during the 15 minutes capsule using the signal from condition tool. 

    image.png

     

    Step 4: calculate the max value with rolling 3y period using signal from condition tool. you can choose to put the value at the start of the capsule or at the point of max value so you'll know the exact year the maximum value occurred.

    image.png

     

    Let me know if this is what you're looking for or alternatively you can talk directly to our Analytics Engineer during the Office Hour. You can book your session here: https://info.seeq.com/office-hours

     

  9. You can follow steps below to push the calculation. I would suggest to split the 150 signals into 15 tables so you have 10 columns only in 1 table. You can list down your signals name in a csv file and upload to your seeq datalab project. Click New and create a new Python 3 notebook. You can then start to write the script below:

    Step 1: Import the pandas library

    import pandas as pd

    Step 2: script below will read the signals name listed in the csv)

    my_items = pd.read_csv('taglist.csv') #edit the csv file here to match the csv file name you uploaded 

    Step3: search the signals listed above

    my_items = spy.search(my_items)
    my_items

    Step 4: Since all calculations are using same periodic condition which is hourly, you can create the condition first in the workbench (1 time only) and call it in Datalab as below:

    search_condition = spy.search({"Name":"Hourly"}) #make sure the condition name you created in workbench is named Hourly as well

    Step 5: Apply the formula to all signals by creating a scorecard metric. In this example we're trying to find the last value so the statistic used is Value At End.

    resultdf=pd.DataFrame()
    
    for index, row in my_items.iterrows():
        my_metric_input_condition = {
            'Type': 'Metric',
            'Name': row['Name'] + '_last value',
            'Measured Item': row['ID'],
            'Statistic': 'Value At End',
            'Bounding Condition': {'ID': search_condition[search_condition['Name'] == 'Hourly']['ID'].iloc[0]},
        }
       # Append the result to the empty dataframe
        resultdf = resultdf.append(my_metric_input_condition, ignore_index=True)
    
    
    resultdf

    Step 6: Push the scorecard metric to your workbench.

    spy.push(metadata = resultdf, workbook='0EE61BAE-3EC2-7760-9367-553D489D11D8') #change the workbook ID to your workbook ID

    Step 6: Open the link to workbench, and you can see the calculations last value generate like this:

    image.png

    Change the View to Table and click Condition Table to view it as table. 

    image.png

    Let me know if you need further help.

  10. Hi Francesco,

    Yes, we can push using SDL but I'm just curious how many signals you want to view in one table? 150 is a lot and have you considered creating Asset Tree instead? You can read more about Asset Tree here: https://python-docs.seeq.com/user_guide/Asset Trees 1 - Introduction.html

    If you think your signals are not suitable to arrange in asset tree do let me know and I'll share a script to push the signals.

  11. Now that I read your question again, I think you can also use this method, if you already have condition you want to use for you average calculation.

    After Step 1 above, you can use within function to create new signal that have positive values only.

    image.thumb.png.15682110693d4f26197ed8fe35b3508c.png

    Next, you can continue with Step 2 above, but this time change the signal to new signal from formula above (in my case here the name is Positive signals), and condition to the specific condition that you already have (in my case is Hourly condition).

    image.thumb.png.809c12873e20f476e6b239656fdf450b.png

     

    Hope it helps!

     

  12. Hi Jenny,

    First, you can create condition for positive values only using Value Search tool. It will generate capsules for samples with value greater than 0.

    image.thumb.png.72a9fa1a7e0d36c2f03aeff6b314090a.png

    Next you can use Signal from Condition tool to find the average values during this positive value condition.

    image.thumb.png.24dbb1ffa644fd18808ef9020ee2b18c.png

     

    Let me know if this answers your question. Alternatively, you can also sign up for Office Hour session where you can discuss with our Analytics Engineer directly 🙂

     

  13. Hi Margarida,

    You can use the runningSum function in formula tools. For example:

    $signal.runningSum($condition.setMaximumDuration(7d))

    The $signal here is the amount of feed added everytime the valve is open, and the $condition is the batch condition. You can set the maximum duration based on the capsule duration of batch but in this example here I just used 7 days. It should give you something like this:

    image.thumb.png.5b4b06dca21113602946c9f400da7e8f.png

     

    Let me know if this answered your question or you need further clarification. 

     

  14. Question from user: 

    I’d like to create a capsule defined as follows: When a valve transition from closed to open (this data (pi tag) is a string). I’d like the capsule to be limited to the first minute after the valve transition occurs.

    Answer:

    Use this equation in Formula tool:

    $open = $a ~= "Open" //create condition when the valve is open, a is your valve signal 
    $open.afterStart(1min) //Create a condition with capsules ending 1mins after start of $open

    It will give result as shown in screenshot attached.

     

    image-20220610-073429.png

  15. Hi Siang Lim,

    This is one way I could think of.

    Step 1: Calculate Total Count (Yearly)

    image.thumb.png.5f0fdffa397107e14ff4edb2201d8a09.png

    Step 2: Calculate the normalized count for each bin. Example here is for bin 85-90. Repeat the step for all your bins.

    $signal
    .within($signal.isbetween(85,90))
    .aggregate(count(),$yearly, startKey())
    .toDiscrete()
    .divide($total_yearly_count)

    image.thumb.png.d49aa37f19ee9122d08e2a33eec6c2d2.png

     

    Step 3: Combine all the normalized count for all the bins and move it as example below.

    combinewith(
    $nc95.move(1min),
    $nc90.move(2min),
    $nc85.move(3min)
    )

    image.thumb.png.366c019533139e9350580f7a0416cfee.png

     

    Step 4: Create the conditions and set property.

    $ref = $y.afterStart(1.1min)
    
    combinewith(
    $ref.move(1min,0).setProperty('Bin','95-100'),
    $ref.move(2min,1min).setProperty('Bin','90-95'),
    $ref.move(3min,2min).setProperty('Bin','85-90')
    )

    Note: Ensure the move settings are aligned with the above step. For example, the normalized for bin 90-95 is moved at 2 minutes at step 3 and step 4.

    image.thumb.png.8ddf98db7e0c569cafe7a58be8ea5b87.png

    Step 5: Create the histogram.

    image.thumb.png.51120ad3db19cb162bb6ebe1dda7c739.png

    image.thumb.png.c90e6ed7fd9b8e1b396d1501b015b86b.png

     

  16. image.png.18f40d9d38c46aa5095be8a70e168122.png

    Here’s an example on how to add color threshold so that it alerts when the current value to day deviates by +-5 degF

    Step 1: Calculate daily average temperature using signal from condition.

    Step 2: Create the high  and low limits in the formula as below:-

    High Limit: 

    ($averagetemperature.move(1d))+5

    Low Limit: 

    ($averagetemperature.move(1d))-5

    Step 3: Add the high and low limits in the metric's threshold as below screenshot:-

    image.png.06c4050bc7ac289e61c03d896d161183.png

    • Like 2
  17. 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.

    image.png.3786aa122308e1bccb9693aca2094c27.png

     

    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.

    image.png.efb19d5990c2536af444f07090b5c9c7.png

     

    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.

    • Like 2
×
×
  • Create New...