aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/example_csv.toml34
-rw-r--r--examples/financial.xlsxbin0 -> 71637 bytes
-rw-r--r--examples/importer.toml44
-rw-r--r--examples/importer_groupe.toml28
4 files changed, 106 insertions, 0 deletions
diff --git a/examples/example_csv.toml b/examples/example_csv.toml
new file mode 100644
index 0000000..1374515
--- /dev/null
+++ b/examples/example_csv.toml
@@ -0,0 +1,34 @@
+version = 1
+
+[source]
+ file = "importer.csv"
+ name = "source"
+
+[externals.target]
+ intern_key = ":source.A"
+ extern_key = ":A"
+ file = "financial.xlsx"
+ allow_missing = false
+
+[externals.a_financial]
+ intern_key = ":target.A"
+ extern_key = ":O"
+ file = "financial.xlsx"
+ allow_missing = false
+
+[sheet]
+ columns = [
+ ":A",
+ "concat(\"-\", :A, :target.E, :B)",
+ ":C",
+ """counter(
+ [:C],
+ [:A])""",
+ ":E",
+ "match(\"\\(..\\)\", :B)",
+ ":D",
+ "counter([:D] ,[:A])"
+ ]
+ filters = []
+ sort = []
+ uniq = []
diff --git a/examples/financial.xlsx b/examples/financial.xlsx
new file mode 100644
index 0000000..6ed8522
--- /dev/null
+++ b/examples/financial.xlsx
Binary files differ
diff --git a/examples/importer.toml b/examples/importer.toml
new file mode 100644
index 0000000..4be6618
--- /dev/null
+++ b/examples/importer.toml
@@ -0,0 +1,44 @@
+version = 1
+
+[source]
+ file = "financial.xlsx"
+ name = "source"
+
+[externals.target]
+ intern_key = ":source.A ^ '-suffix'"
+ extern_key = ":A ^ '-suffix'"
+ file = "financial.xlsx"
+ allow_missing = false
+
+[externals.a_financial]
+ intern_key = ":target.A"
+ extern_key = ":O" # This key is here to generate errors
+ file = "financial.xlsx"
+ allow_missing = false
+
+[sheet]
+ columns = [
+ ":target.A ^ '\\''", # Ensure the quote is escaped before sending to the sql engine
+ "concat('-', :A, :target.E, :B)",
+ ":C",
+ "counter([:C], [:A])",
+ "sum(:F, [:B, :C, :D], [:B])",
+ "int(1) = counter([:C], [:A])",
+ ":E", "match('(..)', :B)",
+ ":D",
+ "counter([:D], [:A])",
+ "year(:N)",
+ # Apply a function on the year
+ """:Q
+ -
+ # We only keep the years after Y2K
+ 2000"""
+
+ ]
+ filters = [
+
+ "1 = counter( [:B], [:A])",
+
+ ]
+ sort = []
+ uniq = []
diff --git a/examples/importer_groupe.toml b/examples/importer_groupe.toml
new file mode 100644
index 0000000..eb2f7e6
--- /dev/null
+++ b/examples/importer_groupe.toml
@@ -0,0 +1,28 @@
+# Cet exemple permet de montrer la combinaison de fonction de groupe avec des
+# filtres.
+
+# On recherche ici le plus grand nombre d’unitées vendues en France.
+# Pour que le résultat soit conforme à l’attendu, il faut que l’application
+# commence par filtrer les lignes qui concernent la France, avant de chercher
+# la ligne contenant le plus grand nombre d’unités.
+
+version = 1
+
+[source]
+ file = "financial.xlsx"
+ name = "source"
+
+[sheet]
+ columns = [
+ ":A",
+ ":C",
+ ":D",
+ ":N",
+
+ ]
+ filters = [
+
+ ":C = 'France'",
+ ":A = max(:A, [:D], [:F])",
+
+ ]