A unique column in the Foundry system that utilizes function-backed technology to calculate the monthly usage of engines over a

In my dataset of ‘Engine Hours’, I have the following information:

Engine# Date Recorded Hours
ABC123 Jan 21, 2024 9,171
ABC123 Dec 13, 2023 9,009
ABC123 Oct 6, 2023 8,936
XYZ456 Jan 8, 2024 5,543
XYZ456 Nov 1, 2023 4,998
XYZ456 Oct 10, 2023 4,002

In another set of data for ‘Engine’, I display the latest Engine Hours in a Workshop Object Table by linking it to the 'Engine Hours' objects with an aggregation on the property 'Maximum' to show the most recent recorded hours.

Engine# Date Recorded Latest Hours
ABC123 Jan 21, 2024 9,171
XYZ456 Jan 8, 2024 5,543

Now, I am looking to add a column that shows the average monthly usage over a rolling 3-month period. I believe this can be achieved using a Function-Backed Column, but I lack the knowledge of TypeScript to create it myself. I have tried searching for similar examples within Palantir Learning resources and online, but haven't found a solution yet.

Does anyone have a template or example code for a similar Function-Backed Column that I could use for this specific case?

Thank you!

Answer №1

To support a derived column in an Object Table within Workshop, you would typically require a Function.

Here is a demonstration of how this can be achieved by dividing the logic into two separate functions:

  1. The first function operates on a set of objects and generates a mapping between each object and the calculated value (e.g., the average over the last 3 months).
  2. The second function computes the desired value for a specific object.

There are several benefits to utilizing this approach:

  • You can utilize the second function to populate various widgets (such as a Metric Card) by simply passing an object and retrieving the corresponding value without duplicating the logic.
  • The parallelization of Function 1 using Promises/asynchronous computation enables efficient processing.

Limitations:

  • Standard enforced limits apply to any applied function, including constraints on memory load (maximum of 100k objects) and compute time (max of 30 seconds).
// Necessary imports...
/*
* 1/ This function returns a "FunctionsMap", acting as a map linking object instances
* with the display value in the derived column for each instance
*/
@Function()
public getDerivedColumn(myEngines: ObjectSet<Engine>): FunctionsMap<Engine, Double>{
    // Implementation details...
}

/* 2/ Function for calculating value for a single object */
@Function()
public async computeMetric(currentEngine : Engine): Promise<Double> {
    // Implementation details...
}

Please note that while this code snippet has not been tested extensively, it should closely align with your requirements.

Additional information on function-backed columns in Workshop

Answer №2

If you're looking to utilize the pipeline builder tool for incorporating data into the Workshop module dashboard, it can be easily accomplished.

You'll come across the average functionality within the tool, requiring some basic mathematical operations in the pipeline builder to prepare the data accordingly.

If you require detailed guidance on navigating this process through the user interface, feel free to reach out. It's designed to simplify management and comprehension of tasks.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Loading local JSON data using Select2 with multiple keys can greatly enhance the functionality

Comparing the select2 examples, it is evident that the "loading remote data" example contains more information in the response json compared to the "loading array data" example. I am interested in knowing if it is feasible to load a local json file with a ...

Using styled-components and typescript to override props

Currently, I am faced with the challenge of using a component that necessitates a specific property to be set. My goal is to style this component with the required property already defined, without having to manually specify it again during rendering. Howe ...

Tips for establishing communication between a server-side and client-side component in Next.js

I am facing a challenge in creating an interactive component for language switching on my website and storing the selected language in cookies. The issue arises from the fact that Next.js does not support reactive hooks for server-side components, which ar ...

Modify the color of every element by applying a CSS class

I attempted to change the color of all elements in a certain class, but encountered an error: Unable to convert undefined or null to object This is the code I used: <div class="kolorek" onclick="changeColor('34495e');" style="background-c ...

Encountering an issue when trying to upload numerous base64 images to Cloudinary through Node.js and receiving an error with code -4064, specifically 'ENAMETOOLONG'

I'm encountering an issue with base64 URLs when trying to upload multiple images to Cloudinary. When I send only one image, it gets uploaded correctly, but when sending multiple images, I receive an error 'ENAMETOOLONG' with error number 406 ...

What is the best way to ensure all requests have been completed before proceeding?

Is there a way to ensure that the sortOrder function only runs once the getOrders function has fully completed its execution? I have considered using a callback, but I am unsure of how to implement it. Do you have any suggestions on how I can achieve this ...

jQuery - Enhancing User Experience with Dynamic Screen Updates

Is there a way to update the screen height when resizing or zooming the screen? Whenever I zoom the screen, the arrows break. I'm also curious if the method I'm using to display images on the screen is effective. It's supposed to be a paral ...

Is there a way to alter the background color of a Material UI card when it is being hovered over

I'm currently using material ui with react and I have a question regarding the background color of my card component when a user hovers over it. Can someone help me figure out how to achieve this? For reference, here is the live code link in CodeSand ...

Here's a unique rewrite: "Learn how to manipulate the CSS class of a textarea element (specifically in NicEdit) by utilizing the addClass

I am currently validating a textarea using the NicEdit plugin. var getContent = nicEditors.findEditor("SubSliderDescription").getContent(); bValid = bValid && checkBlankTextArea(getContent, "SubSliderDescription") function checkBlankTextArea(o, ...

Tips for showing more rows by clicking an icon within an Angular 2 table

When I click on the plus (+) button in the first column of each row, only one row expands. How can I modify it to expand multiple rows at a time? Thanks in advance. <div> <table class="table table-striped table-bordered"> <thead> ...

Retrieving information from a JSON web service can easily be done using just JavaScript and jQuery

I recently downloaded a sample application from the following URL: . I am pleased to report that the part I have implemented is functioning flawlessly: <script src="scripts/jquery-1.3.2.debug.js" type="text/javascript"></script> <script src ...

Looking to increase the resolution of a 512x512 heightmap array of pixels in a png image to 2017x2017 using JavaScript for implementation as a heightmap in Unreal Engine 4?

I have a task of converting a 512 x 512 32-bit RGB PNG image with encoded height values into a 16-bit grayscale PNG representing height values for a height map. Below is the code used for this conversion: The image conversion process utilizes image-js li ...

Display <div> exclusively when in @media print mode or when the user presses Ctrl+P

Looking for a way to create an HTML division using the div element that is only visible when the print function is used (Ctrl+P) and not visible in the regular page view. Unfortunately, I attempted the following method without success. Any advice or solut ...

Using Parseint in a Vue.js method

For instance, let's say this.last is 5 and this.current is 60. I want the sum of this.last + this.current to be 65, not 605. I attempted using parseInt(this.last + this.current) but it did not work as expected. <button class="plus" @click="plus"&g ...

passport.authenticate method fails due to empty username and password values

I seem to be making a simple mistake while following a tutorial. Even though I believe I have followed all the steps correctly, when I submit the login form, I get redirected to the "failureRedirect" page. When I checked the source code in the passport mod ...

Angular 4 Web Application with Node-Red for Sending HTTP GET Requests

I am creating a unique service that utilizes Node-red to send emails only when a GET request is made to 127.0.0.1:1880/hello (node-red port), and an Angular 4 web app (127.0.0.1:3000) for client access. Upon accessing the /hello page from a browser, I rec ...

Exploring the option of eliminating the email field from the PHP redirect function and transforming it into a pop-up notification

I am currently utilizing the following code to send an email notification to my address whenever a new user signs up: <?php $errors = ''; $myemail = '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b0ded1ddd ...

Customizing ExtJS 4.1: Mastering field overrides

Seeking guidance on applying a plugin to all fields(numberfield, textfield, datefield, etc.) within the ExtJS 4.1 library. Does anyone have suggestions on how to achieve this? I understand that all fields are derived from BaseField. I attempted the follow ...

Dividing a string into an array and displaying it in a table using Laravel

Retrieving a string from the database and using the explode function to split the values. Below is the code snippet: $data = DoctorRegistration::select('products') ->where('doctorid','=',$doctorid) ->get(); ...

Creating an Account with Firebase

I've created a function called signup in my web project that uses JavaScript to add a user to my Firebase database. The function works fine, but I'm encountering an issue when I try to redirect to another page at the end of the function - the use ...