My Products
Help
Elling Bjåstad
CONTRIBUTOR **

Extraction of general ledger balance data on multiple dimensions

by Elling Bjåstad

Hi,

We're currently using the following GraphQL query to extract general ledger balance data on one dimension:

 

{
  useCompany(no: 1234567) {
    generalLedgerBalanceForOrgUnit1(filter: { year: { _eq: 2023 } }) {
      items {
        accountNo
        year
        period
        cbDomestic
        orgUnit1
      }
    }
  }
}

 

Is it also possible, through the API, to extract data on more than one dimension, such as both OrgUnit1 and OrgUnit2?

5 REPLIES 5
Accepted solution
Øyvind Årseth
VISMA

by Øyvind Årseth

@Elling Bjåstad I suppose what you are looking for is general ledger transactions grouped by account and org units? 

Elling Bjåstad
CONTRIBUTOR **

by Elling Bjåstad (Updated ‎25-01-2024 13:22 by Elling Bjåstad )

Yes, if orgUnit1 is department and orgUnit2 is project, we want the ability to query general ledger transactions grouped by year, period, account, department and project, so that we get individual numbers for each combination of department and project.

 

Edit: I looked briefly at the new groupBy feature, and it seems as if it covers what we need.

Accepted solution
Marius Bancila
VISMA

by Marius Bancila

I'm not sure I understand the kind of query we are looking for. Our grouping works for data from one table. If we need to group together data from multiple tables, it won't work. So, I'd like to see a textual description or pseudo-query in order to better understand the need.

by Øyvind Årseth

@Marius Bancila I think this is a need for the "groupBy"-feature to get the balance of different account/orgunit-combinations. 

by Marius Bancila

Do you mean like this?

query gl_balance_multiple_dimensions
{
  useCompany(no: 1234567) {
    generalLedgerBalanceForOrgUnit1(filter: { year: { _eq: 2023 } }) {
      items {
        accountNo
        year
        period
        cbDomestic
        orgUnit1
      }
    }
    
    generalLedgerBalanceForOrgUnit2(filter: { year: { _eq: 2023 } })
    {
      items {
        accountNo
        year
        period
        cbDomestic
        orgUnit2
      }
    }
  }
}