Git Product home page Git Product logo

dbt_xero's Introduction

Apache License dbt logo and version

Xero

This package models Xero data from Fivetran's connector. It uses data in the format described by this ERD.

The package’s primary focus is to transform the core tables into analytics-ready models, including a profit and loss report, general ledger, and balance sheet report.

Models

This package contains transformation models, designed to work simultaneously with our Xero source package. A dependency on the source package is declared in this package's packages.yml file, so it will automatically download when you run dbt deps. The primary outputs of this package are described below.

model description
xero__general_ledger Each record represents a journal line item. Use the ledger to create the balance sheet and the profit and loss statement.
xero__profit_and_loss_report Each record represents a profit and loss line item at the month and account level.
xero__balance_sheet_report Each record represents the state of the balance sheet for a given account on a given month.
xero__invoice_line_items Each record represents an invoice line item enriched with the account, contact, and invoice information.

Note about currency gains

If you are using multi-currency accounting in Xero, you are likely to have unrealized currency gains as part of your profit and loss statement. These gains/losses do not exist within the actual journals in Xero. As a result, you will find that those lines are missing from the outputs of this package. All realised currency gains will be present and your balance sheet will still balance.

Installation Instructions

Check dbt Hub for the latest installation instructions, or read the dbt docs for more information on installing packages.

Include in your packages.yml

packages:
  - package: fivetran/xero
    version: [">=0.2.0", "<0.3.0"]

Configuration

By default, this package will look for your Xero data in the xero schema of your target database. If this is not where your Xero data is,add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
config-version: 2

vars:
    xero_schema: your_schema_name
    xero_database: your_database_name 

Disabling and Enabling Models

When setting up your Xero connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Xero or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables.

By default, all variables are assumed to be true. You only need to add variables for the tables you would like to disable:

# dbt_project.yml

config-version: 2

vars:
    xero__using_credit_note: false                    # default is true

For additional configurations for the source models, visit the Xero source package.

Changing the Build Schema

By default this package will build the Xero Source staging models within a schema titled (<target_schema> + _stg_xero) and the Xero final transform models within a schema titled (<target_schema> + _xero) in your target database. To overwrite this behavior, add the following configuration to your dbt_project.yml file:

# dbt_project.yml

...
models:
    xero:
        +schema: my_new_final_models_schema # leave blank for just the target_schema
    xero_source:
        +schema: my_new_staging_models_schema # leave blank for just the target_schema

Contributions

Don't see a model or specific metric you would have liked to be included? Notice any bugs when installing and running the package? If so, we highly encourage and welcome contributions to this package! Please create issues or open PRs against master. See the Discourse post for information on how to contribute to a package.

Database Support

This package has been tested on BigQuery, Snowflake, Postgres and Redshift.

Resources:

dbt_xero's People

Contributors

dylanbaker avatar fivetran-joemarkiewicz avatar fivetran-abhijeet avatar kristin-bagnall avatar

Watchers

James Cloos avatar

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.