Jump to content

Sharlinda Salim

Seeq Team
  • Posts

    28
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Sharlinda Salim

  1. Hi Dayyan,

    For the second question:-

    1. Create a 6 month interval condition using formula

    periods(6mo)

    2. Split the 6month when there's replacement condition using the Composite Condition > A minus B as below screenshot.

    image.png

    3. Use the count function for individual manual draining
    image.png

    4. Use runningCount() for the tracking purpose. At the below screenshot, after the replacement condition, it will automatically reset to zero. Please let me know if there's any criteria here did not meet your requirement.
    image.png

    • Like 1
  2. Hi Dayyan,

    On your first question: How can I effectively create a capsule or representation for this seal replacement?

    Seems you have the derivative signal, you can :-

    1. Use value search to create the condition when the derivative < 0,
    2. Use value search to create the condition when the derivative > 0
    3. Use Composite Condition > Join to join (1) and (2)

    On your second question, are you currently using runningCount() to track the occurrences of manual draining? 

  3. Hi Olav,

    There is a workaround in XY Plot but it may not able to plot exactly the same as your Power BI screenshot.

    Step 1: Create the binning conditions using value search. As an example I created 4 conditions with bin size of 10.

    image.png

     

    Step 2: Create the condition for June and July

    join(
    months(Month.June, "Asia/Kuala_Lumpur"),
    months(Month.July, "Asia/Kuala_Lumpur"),90d)

    Step 3: Calculate the average value during each bin in June&July and combine them together. The move is to avoid overlap at the same startkey.

    combinewith(
    $t.within($b010).aggregate(average(),$june_july,startKey(),0s).move(1h),
    $t.within($b102).aggregate(average(),$june_july,startKey(),0s).move(2h),
    $t.within($b203).aggregate(average(),$june_july,startKey(),0s).move(3h),
    $t.within($b304).aggregate(average(),$june_july,startKey(),0s).move(4h))

    image.png

    Step 4: Used the setproperty() to create the corresponding X value for each of the average value.

    combinewith(
    $t.within($b010).aggregate(average(),$step2,startKey(),0s).move(1h).toCapsules().setProperty('Bin',10),
    $t.within($b102).aggregate(average(),$step2,startKey(),0s).move(2h).toCapsules().setProperty('Bin',20),
    $t.within($b203).aggregate(average(),$step2,startKey(),0s).move(3h).toCapsules().setProperty('Bin',30),
    $t.within($b304).aggregate(average(),$step2,startKey(),0s).move(4h).toCapsules().setProperty('Bin',40))
    .toSignal('Bin',startKey()).toDiscrete()

    image.png

    Step 5: Switch to the XY Plot and expand the date range. Create the individual conditions for each year and you can then color based on these conditions.

    image.png

    Let me know first is this workaround suits you.

     

  4. Hi mKaiser,

    The main constraint here is calculation based on display date range is possible via simple metric only.

    I have one suggestion and please let me know your thought and correct me too if I'm not capturing correctly your criteria.

    Step 1 & 2 similar as yours.

    Step 3 : Set the date range of interest using the manual condition.

    image.png

    Step 4 : Calculate the average and percentile using Signal from condition and bounded it to Step 3 condition.

    image.png

    Step 5: This is another tricky step as you need to define the date range in identifying the final condition. Example in the last 6month.

    condition(6mo,capsule(now()-6mo,now()))

    Step 6 : Use value search and composite condition to define the final output. I have these functions in one formula. I am not 100% sure whether I understand this final criteria but let me know if you need further help.
     

    //isbetween two percentile signals or certain range above average
    
       ($step2 <= $percentile_90.aggregate(startValue(true), $step5, durationKey())
    and $step2 >= $percentile_80.aggregate(startValue(true), $step5, durationKey()))
    or
       ($step2 > $average.aggregate(startValue(true), $step5, durationKey()))

    So each time you change the date range at the manual condition, the whole calculation will automatically recalculate limited to step5 definition.

  5. Hi Taylor,

    Before we discuss the Table part, I would just like to point out that displaying similar result in a trend view is easier by utilizing our 'Capsule' view. KB article

    image.png

    In order to visualize in Table, there are more steps depending on how many samples you have in a day. 

    Step 1: Create the daily condition.

    Step 2: Create capsules for each sampling point

    $a.toDiscrete().toCapsules()

    Step 3: From Step (2), extract the first to the nth capsule. Notice that I had also embedded all the samples value into the daily condition. Hopefully you are dealing with lab data or similar where you are not expecting too many sampling in a day.

    //find each sampling point
    $capsule1 = $daily.transform($w ->$all_sampling.toGroup($w).first())
    $capsule2 = $daily.transform($w ->$all_sampling.toGroup($w).pick(2))
    $capsule3 = $daily.transform($w ->$all_sampling.toGroup($w).pick(3))
    
    //Embedded the value into daily condition and label Sample 1,2,3 accordingly.
    $daily
    .setproperty('Sample 1', $signal.aggregate(startValue(true), $capsule1, startKey(), 0s), startValue())
    .setproperty('Sample 2', $signal.aggregate(startValue(true), $capsule2, startKey(), 0s), startValue())
    .setproperty('Sample 3', $signal.aggregate(startValue(true), $capsule3, startKey(), 0s), startValue())

    image.png

    Step 4: Switch to the Table view and set accordingly as per below screenshot.

    image.png

    image.png

    image.png

    In case you did not able to view all the features I had used here, please check out the lower left corner of your Seeq browser window to see which version you have.

     

     

  6. 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 = 
    
    $f
    .toSignal('End')
    .toString()
    .replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
              '${month}')
    
    //changing the name format
    
    $month_alphabet =
    
    experimental_lookupTable(
    "[
     ['01', 'Jan'],
     ['02', 'Feb'],
     ['03', 'March'],
     ['04', 'April'],
     ['05', 'May'],
     ['06', 'June'],
     ['07', 'July'],
     ['08', 'August'],
     ['09', 'September'],
     ['10', 'October'],
     ['11', 'November'],
     ['12', 'December']  
     ]",
    InterpolationMethod.Discrete)
    $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/' , 
                    '${day}')
    
    
    
    $YYYYhhmm = $extract
                .replace('/(?<year>....)-(?<month>..)-(?<day>..)T(?<hour>..):(?<minute>..):(?<sec>..)(?<dec>.*)Z/' , 
                        '${year} ${hour}:${minute}')
    
    
    
    $final = $day + ' ' +$month_alphabet+ ' ' +$YYYYhhmm
    return $final

    image.png

    Hope this helps.

  7. 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.

    image.png

    image.png

    image.png

  8. To Create a rolling linear forecast on data, we can use the formula tool:

    $signal.forecastLinear(7d,3d)

    As of R63 you can also use the ForecastArima function in Seeq Formula as well to create a rolling forecast. Please see the following knowledgebase article for more information on how to use ForecastArima: https://support.seeq.com/kb/latest/cloud/best-practices-for-using-forecastarima

    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). 

     

    Content Verified DEC2023

  9. 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)
  10. 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.
                  .toSignal('Start')
                  .toString()
                  .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
                 .validValues()
                 .toStep(1d)
    $YYYYMMDD

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

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

    Followed by another formula,

    $s.toSignal('Shift')

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

    $count = $batch.aggregate(count(),$batch, startkey(),0s)
    
    $count
    .runningCount($shift)
    .toStep(1d)
    .toString()

    STEP 4 : Create the BatchID and set as property
     

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

    image.png

    • Like 1
  11. 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.

    image.png

    Step 3: Replace the samples with the aggregated value 

    image.png

    image.png

    Hope this help.

     

     

  12. 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. 

    image.png

×
×
  • Create New...