Code Monkey home page Code Monkey logo

Comments (3)

jkusa avatar jkusa commented on June 22, 2024

Hi @QubitPi 👋 , Elide & Yavin supports all the functions your database supports (including aggregation). Here is an example from our demo config that uses sum, case, cast, and replace:

definition: "sum(cast (case when {{$duration}} like '% Seasons' then REPLACE({{$duration}}, ' Seasons', '') else '0' end AS INT))"

Not sure if you are looking to aggregate when calculating "speed", but this is an example I was able to create on our demo data without aggregation:

        {
          name: speed
          friendlyName: Speed
          category: Stats
          type: Decimal
          definition: '''
            (cast (case when {{$duration}} like '% min' then REPLACE({{$duration}}, ' min', '') else '0' end AS INT)) / ( NULLIF( DATEDIFF( YEAR, PARSEDATETIME({{$release_year}}, 'yyyy'), PARSEDATETIME({{$date_added}}, 'yyyy') ),  0) )
          '''
        }

This takes the duration of a movie in minutes and divides it by the difference in years between the year it was available on netflix and the movie release year.

from framework.

QubitPi avatar QubitPi commented on June 22, 2024

Hi @jkusa, thank you very much for the prompt response. The movie example you provided really helped. With your hints, we can see the desired Yavin report with

        {
          name: speed
          friendlyName: Speed
          category: Stats
          type: Decimal
          definition: '''
            {{$total_amount}} / ( NULLIF( DATEDIFF( DAY, PARSEDATETIME({{$task_start_date}}, 'yyyy-mm-dd'), PARSEDATETIME({{$task_finish_date}}, 'yyyy-mm-dd') ),  0) )
          '''
        }

This helps our team a lot! We will dive into Yavin and Elide docs to learn more. Thanks again!

from framework.

QubitPi avatar QubitPi commented on June 22, 2024

Issue resolved. Thanks

from framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.