Last active
March 8, 2023 11:55
-
-
Save jdunkerley/44d0e1f66fedad1223a3a08bd44c440d to your computer and use it in GitHub Desktop.
Preppin Data Week 1 - in Enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Standard.Base import all | |
from Standard.Table import all | |
from Standard.Database import all | |
import Standard.Visualization | |
func1 operator11 = | |
operator12 = operator11.split "-" | |
operator13 = operator12.first | |
operator13 | |
main = | |
operator3 = enso_project.data/"PD 2023 Wk 1 Input.csv" . read | |
operator1 = operator3.get 'Transaction Date' | |
operator2 = operator1.parse Date "dd/MM/yyyy 00:00:00" | |
operator4 = operator3.set operator2 | |
operator5 = operator2.first | |
operator6 = _.format "EEEE" | |
operator7 = operator2.map operator6 | |
operator8 = operator7.rename "Day of Week" | |
operator9 = operator4.set operator8 | |
operator10 = operator9.get 'Transaction Code' | |
operator11 = operator10.first | |
operator13 = Main.func1 operator11 | |
operator12 = operator10.map Main.func1 | |
operator14 = operator12.rename "Bank" | |
operator15 = operator9.set operator14 | |
operator16 = operator15.set 'IF [Online or In-Person] == 1 THEN "Online" ELSE "In-Person"' "Online or In-Person" | |
operator17 = operator16.aggregate [Aggregate_Column.Group_By "Bank", Aggregate_Column.Sum "Value" "Value"] | |
operator18 = operator16.aggregate [Aggregate_Column.Group_By "Bank", Aggregate_Column.Group_By "Online or In-Person", Aggregate_Column.Group_By "Day of Week", Aggregate_Column.Sum "Value" "Value"] | |
operator14 = operator16.aggregate [Group_By "Bank", Group_By "Customer Code", Sum "Value" "Value"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment