Jump to content

Sharlinda Salim

Seeq Team
  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by Sharlinda Salim

  1. Hi Nurhaz,

    This is one possible method:-

    Step 1 : Create a new formula where we convert the month format based on your preference

    $month_numeric = 
    .replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
    //changing the name format
    $month_alphabet =
     ['01', 'Jan'],
     ['02', 'Feb'],
     ['03', 'March'],
     ['04', 'April'],
     ['05', 'May'],
     ['06', 'June'],
     ['07', 'July'],
     ['08', 'August'],
     ['09', 'September'],
     ['10', 'October'],
     ['11', 'November'],
     ['12', 'December']  
    $month_alphabet.experimental_lookup($month_numeric, 'B')

    Step 2 : Configure the sequence/format based on your preference

    $extract = $f.toSignal('End').toString()
    $day = $extract
           .replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
    $YYYYhhmm = $extract
                .replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
                        '${year} ${hour}:${minute}')
    $final = $day + ' ' +$month_alphabet+ ' ' +$YYYYhhmm
    return $final


    Hope this helps.

  2. Hi Nurhaz,

    The easiest will be to configure at the header. In this example, I used Simple Table >> Last Value, followed by customizing the header as showed in the second screenshot. If you click at the '?' beside the Date Format it will provide you more formatting options. Finally, you can add another column and name it 'Last Sample Time".

    This method is applicable still if you prefer to use Scorecard Metric.

    The difference between this method and the one discussed above is this method will generate the last value too.




  3. This method can now be simplify using the below formula :-


    Please do have a look at few other discussions as below links that applied the forecastlinear() function.

    The cumulative of time as shown in Step 3 can be simplified to timesince($condition,1min). 


  4. Hi Nurhaz,

    You may also book a slot in Seeq Office Hours to discuss further in a call. (https://info.seeq.com/office-hours)

    Firstly, I observe your condition for the $run can be optimize as the start of the capsule seems slightly off than the peak of your signal.

    If you could not join the office hour can you share how you create the $run condition.

    Secondly, did you use exact formula as below including the 10d setting? Your $run seems longer than 10d so you might want to expand that, probably 3mo.

    timeSince($runs.growEnd(10d), 1h)
  5. Interesting question from a Seeqer who would like to create a BatchID for each batch with the format YYYYMMDDS# where YYYY is the year, MM is month, DD is day, S is the shift and # is the order of the batch in that shift. 

    This is one of the possible method.

    STEP 1: Create the signal for YYYYMMDD

    //STEP1: Trend the "Start" date of each capsule
    $StartDate =  $batch
                  .move(7h) //based on time zone use in workbench.
                  .move(-7h) //move back the signal to the original position
    //STEP2: Replace the format to YYYYMMDD
    $YYYYMMDD = $StartDate
                 .replace('/^(..........).*/' , '$1') //example of the output is 2022-09-02
                 .replace('-','') //20220902

    STEP 2: Create the signal for S which represent the shift number

    shifts (6, 12, "Asia/Kuala_Lumpur").setProperty('Shift','1'),
    shifts(18, 12, "Asia/Kuala_Lumpur").setProperty('Shift','2'))

    Followed by another formula,


    STEP 3 : Create the # which represent batch sequence in the respective shift

    $count = $batch.aggregate(count(),$batch, startkey(),0s)

    STEP 4 : Create the BatchID and set as property

    $BatchID = $YYYYMMDD + $S + $x
    $batch.setProperty('BatchID', $BatchID, StartValue())


    • Like 1
  6. Hi Sivaji,

    Step 1: Calculate aggregated value of every n-samples. Example here I am calculating the average for every 5 samples.

    Use aggregateByCount which is introduced in version R54.

    $signal.aggregateByCount(average(), 5, 10d)

    Step 2: The difference between the sample and aggregated value is greater than certain threshold

    These capsules will be  0s duration as the aggregateByCount generated a discrete signal.


    Step 3: Replace the samples with the aggregated value 



    Hope this help.



  7. Hi VpJ,

    You mentioned gap and missing data, does it looks similar like below screenshot?
    In this case, instead of creating manual condition you can use the function .isNotValid() in the formula tool. With this, you do not need to worry when scaling it across assets. 


  8. Hi Lyna,

    Thank you for your question. 

    In order to plot the starting value, your formula will be like this '$condition.transformToSamples($capsule -> sample($capsule.getStart(), $signal.toScalars($capsule).first()), 1d)'.

    The command '$signal.toScalars($capsule).first()' will get the first value in each capsules. Alternatively, you can also write it as '$signal.toScalars($capsule).pick()'.

    Hope this helps.

  • Create New...