Code Monkey home page Code Monkey logo

Comments (6)

danieltaft avatar danieltaft commented on June 10, 2024 2

Thanks Joe.

With your advice I was able to do this.

First ever dbt PR attempted.
#30

from dbt_xero.

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 10, 2024

Hi @danieltaft thanks so much for opening this issue!

After looking closer at the issue you described above, there definitely seems to be something that needs to be adjusted within the package logic to ensure this net_amount duplication does not happen.

I did a quick look and believe I found the cause for this erroneous multiplication of the amounts when being unioned. We can see below that the xero__balance_sheet_report is being cross joined on a previous CTE.

However, this above CTE does not have the source_relation field. As such, we are cross joining without a where condition to ensure the source relations match on this cross join. As such, the totals for net_amount are incorrectly added on top of the other sources.

I believe a proper fix would involve adding a source_relation field within this CTE and then adding the following where clause to the joined CTE.

where year_end.source_relation = ledger.source_relation

I see you are open to creating a PR! 🏅 If you would like to attempt a PR I would be happy to assist you further 😄 Let me know if you would be interested. Otherwise, our team will be able to pick this up at the start of our next sprint cycle.

from dbt_xero.

fivetran-joemarkiewicz avatar fivetran-joemarkiewicz commented on June 10, 2024

Thanks so much for opening the PR @danieltaft 🏅 We really appreciate contributions from community members as they are what help improve these packages!

Someone from my team will pick up the PR at the start of our next sprint and will let you know if we have any clarifying questions or requests before we merge and release!

from dbt_xero.

fivetran-sheringuyen avatar fivetran-sheringuyen commented on June 10, 2024

Hey @danieltaft congratulations on your first PR! 🥳 I just reviewed it and it looks great. I'm sure you have already checked out that the data looks right on your end, but I want to confirm with you before I make some general updates to make your PR ready for merge and release. Let me know if you have any questions!

from dbt_xero.

danieltaft avatar danieltaft commented on June 10, 2024

Hi @fivetran-sheringuyen - yes I have confirmed it works on my end and the data is correct with this change.

from dbt_xero.

fivetran-sheringuyen avatar fivetran-sheringuyen commented on June 10, 2024

I've just cut the release for your updates @danieltaft, watch out for it on the dbt package hub and looking forward to seeing more contributions in the future! 🎉

from dbt_xero.

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.