Comments (3)
Here are a few examples that I have documented.
Total Amount per Payee between 6 Apr 2020 and 5 Apr 2021
(await $query($q('transactions')
.filter({ $and: [ {date: { $gte: '2020-04-06'}}, {date: {$lte: '2021-04-05'}}]})
.groupBy('payee.name')
.orderBy('payee.name')
.select(['payee.name', {'amount': {$sum: '$amount'}}])
)).data.map((row) => { console.log(`${row['payee.name']}: ${row.amount/100}`) })
Total Amount of all transactions with Note containing #interest (P) between 6 Apr 2020 and 5 Apr 2021
(await $query($q('transactions')
.filter({ '$and': [
{'date': { '$gte': '2020-04-06'}},
{'date': {'$lte': '2021-04-05'}},
{'notes': {'$like': '%#interest (P)%'}} ]
})
.calculate({ '$sum': '$amount' })
)).data/100
or
(await $query($q('transactions')
.filter({ '$and': [
{'date': { '$gte': '2020-04-06'}},
{'date': {'$lte': '2021-04-05'}},
{'notes': {'$like': '%#interest (P)%'}}
]})
.select({ 'total': { '$sum': '$amount' } })
)).data[0].total/100
Total Amount per Category between 6 Apr 2020 and 5 Apr 2021
(await $query($q('transactions')
.filter({ $and: [ {date: { $gte: '2020-04-06'}}, {date: {$lte: '2021-04-05'}}]})
.groupBy('category.name')
.orderBy(['category.group.sort_order','category.sort_order'])
.select(['category.group.name','category.name', {'amount': {$sum: '$amount'}}])
)).data.map((row) => { console.log(`${row['category.group.name']}/${row['category.name']}: ${row.amount/100}`) })
from docs.
Hey @bdoherty
Thanks for this, we have added this to the documentation, which is available here #35
Thanks again
Rich
from docs.
Closing as DONE
from docs.
Related Issues (20)
- 🗄️ [Documentation] - Information on how to not let money roll over from last month. HOT 8
- 🗄️ [Documentation] - Test Issue
- 🔧 [CHANGE] - Image storage and access system HOT 2
- create a demo budget for docs contribution
- ⭐ [Documentation] - instruct the user to cd into directory with fly.toml HOT 2
- SharedArrayBuffer HOT 1
- ⭐ [Documentation] - fly update best practice HOT 3
- 🐛 [BUG] - Cannot install Actual because it cannot locale bindings HOT 4
- 🔧 [CHANGE] - Remove references to `loot-design` package.
- ⭐ [Documentation] - PikaPods HOT 1
- ⭐ [Documentation] - Update filter page for info about saved filters HOT 2
- ⭐ [Documentation] - Settings page images missing highlighted callouts HOT 2
- ⭐ [Documentation] - Move Filter Notes to more appropriate heading HOT 7
- ⭐ [Documentation] - Error in Keyboard Shortcut Notes HOT 5
- Update Nordigen bank sync guide to GoCardless HOT 1
- ⭐ [Documentation] - Getting Started article HOT 1
- ⭐ [Documentation] - Wrong link to fly console HOT 1
- ⭐ [Documentation] - Fly.io HOT 7
- ⭐ [Documentation] - Suggestion to Improve the home page HOT 3
- Docker installation documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs.