Hi everyone, hope you're all well!
Could someone help me with creating this condition? I have a column that shows the remaning time for a job to conclude and i wish to make a visual feedback(like change the background color) based on the percentage of the time remaining.
Also, theres a way to make the trigger or the column update in realtime?
Thank you all in advance!
Hi João,
There are some data sources that support real time updates: Query updates | DataMiner Docs
If you are using any of those, you can enable "Update data" setting on the component to get this feature working. (See the limitations on the GQI operators under the link above too)
If you want to perform this operation over an ad hoc data source, you will have to use the IGQIUpdateable interface.
An example can be found here: SLC-GQIDS-CSV/SLC-GQIDS-CSV_1/SLC-GQIDS-CSV_1.cs at main · SkylineCommunications/SLC-GQIDS-CSV

By default, ad hoc data sources don't support real time updates and that has to be explicitly configured in the code. You can check if it does by checking if the IGQIUpdatable is in use or not.
I don't think column manipulations support live updates, so I'd suggest adding that functionality over the ad hoc data source.
For the column template, I suggest modifying the column to be a number instead of a string. With that you can create range conditions (equal, greater, less…)
As i mentioned unfortunatly i cannot locate the adhoc used in the LCA on the client's Cube, so i cannot verify or implement the inteface in the source code.
How do i modify the column to be a number? The column that i create is a TimeSpan in my code, but the template editor act like it's a string. I'll leave my code here if you can help me understand it.
namespace remainingTimer
{
using System;
using System.Globalization;
using Skyline.DataMiner.Analytics.GenericInterface;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Core.DataMinerSystem;
using Skyline.DataMiner.Core.DataMinerSystem.Automation;
using Skyline.DataMiner.Core.DataMinerSystem.Common;
[GQIMetaData(Name = "Remaining_Time")]
public class RemainingTime : IGQIInputArguments, IGQIColumnOperator, IGQIRowOperator
{
private readonly GQIColumnDropdownArgument _endTimeColumnArg = new GQIColumnDropdownArgument("End Time") { IsRequired = true }; // Input Argument to be requested from the user;
private static readonly GQIColumn<TimeSpan> _remainingTimeColumn = new GQITimeSpanColumn("Remaining time");
private GQIColumn _endTime;
public GQIArgument[] GetInputArguments()
{
return new GQIArgument[] { _endTimeColumnArg };
}
public OnArgumentsProcessedOutputArgs OnArgumentsProcessed(OnArgumentsProcessedInputArgs args)
{
_endTime = args.GetArgumentValue(_endTimeColumnArg);
return new OnArgumentsProcessedOutputArgs();
}
public void HandleColumns(GQIEditableHeader header)
{
header.AddColumns(_remainingTimeColumn);
}
public void HandleRow(GQIEditableRow row)
{
row.TryGetValue<DateTime>(_endTime, out var end);
if(end != null){
var duration = end – DateTime.UtcNow;
TimeSpan formattedTime = duration < TimeSpan.Zero
? TimeSpan.Zero
: new TimeSpan((int)duration.TotalHours, duration.Minutes, duration.Seconds);
row.SetValue(_remainingTimeColumn, formattedTime);
}
}
}
}
Hi Sebastian, thank you for your answer!
The data source is a adhoc made by Skyline, and for some reason even enabling the "Update Data" it wont update in realtime, the update only work with the trigger component that has a lower bound of 5 seconds. The column was generated by a custom operator that i made.
The example of IGQIUpdateable can be made in that custom operator? All information that i find says that some methods needed to be made or enabled in the adhoc, but i cannot find the adhoc that was made by Skyline and used in the LCA in the client Cube.
And do you know anything about the column template customization that i mentioned? I'm trying to change the backgorund color of the cell row based on the percentage of time remaining to end the job, but i cannot make that condition because the table component threats the row data as a string(it comes from the custom operator as a TimeSpan).