Add ability to filter by Account or Merchant
This app imports data file into ^GLOBAL and counts transactions per month into ^COUNT global.
Make sure you have git and Docker desktop installed.
USER>zpm "install iris-globals-contest"
Clone/git pull the repo into any local directory
$ git clone https://github.com/oliverwilms/iris-globals-contest.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
I looked for a menu to navigate between the different CSP pages. I used the existing menu.csp with no changes required.
Try it on your local installation http://localhost:57700/csp/user/menu.csp or - demo
Go to Transact.csp page where the data can be imported. Alternative option from Terminal is shown below…
If your IRIS has no ^GLOBAL, click Import button. It automatically calls class method to import data file into ^GLOBAL.
After Import the button is replaced with Count button. If your IRIS has no ^COUNT, click Count button. It automatically calls class method to count Transaction data into ^COUNT. After Count the button is replaced with Menu button.
You can run adhoc query by entering Start Date, End Date and Filter. Filter is currently only applied to Category. Click Preview button to run query.
Click Menu button to return to menu page.
Go to Count.csp page
It displays monthly totals for number of transactions and total debits and credits. Click on a table row to see counts for the selected month broken down by Categories. Click on Previous button to see counts for the previous month or click Next button to go to next month.
The top-down workflow of this app is the opposite of how the app was developed.
Data originates from Excel
I decided to store the data in ^GLOBAL each cell getting its own node. You can try it out for yourself with this command:
USER>do ##class(dc.iris.util).ImportCSV()
The global looks like this:
I used Brendan Bannon’s Article The Art of Mapping Globals to Classes (https://community.intersystems.com/post/art-mapping-globals-classes-1-3) to map ^GLOBAL to persistent class dc.iris.transact. Now it can be seen here:
Next I created a CSP page where I could filter the transaction data at will.
I wanted to see transaction counts and totals for each category one month at a time. I accumulated data into ^COUNT with this command:
USER>do ##class(dc.iris.count).Count()
The global looks like this:
I created another CSP page to view the monthly data snapshots like this:
You see the above pictured page when you click on any table row of the summary Count.csp pictured below.
I wanted to see monthly totals for a series of months at a glance. Just open Count.csp from the menu:
You can find online demo here - demo