diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/checksum | 6 | ||||
-rw-r--r-- | examples/dataset.toml | 2 | ||||
-rw-r--r-- | examples/externals_filters.toml | 22 | ||||
-rw-r--r-- | examples/importer.toml | 17 | ||||
-rw-r--r-- | examples/importer_groupe.toml | 15 |
5 files changed, 42 insertions, 20 deletions
diff --git a/examples/checksum b/examples/checksum index b223bc4..c47c0ba 100644 --- a/examples/checksum +++ b/examples/checksum @@ -1,3 +1,3 @@ -e158edc600b314e5451cbfbb42fa0a6c importer.csv -e85080e97cd3f1615069232c22e9b9cc example_csv.csv -d646adc7d22212908d7c12a88a19ea4b importer_groupe.csv +e158edc600b314e5451cbfbb42fa0a6c examples/importer.csv +d646adc7d22212908d7c12a88a19ea4b examples/importer_groupe.csv +614c3d20d6c19757fbb76a646809c2e1 examples/externals_filters.csv diff --git a/examples/dataset.toml b/examples/dataset.toml new file mode 100644 index 0000000..dd72cd2 --- /dev/null +++ b/examples/dataset.toml @@ -0,0 +1,2 @@ +[files] + source = "financial.xlsx" diff --git a/examples/externals_filters.toml b/examples/externals_filters.toml new file mode 100644 index 0000000..78e6603 --- /dev/null +++ b/examples/externals_filters.toml @@ -0,0 +1,22 @@ +dataset = "dataset.toml" + +[source] + name = "source" + +# This show how the filter in external works. +# Only the lines with Column C = 'France' will be +# matched. +[externals.source-target] + intern_key = ":source.A" + extern_key = ":A" + filters = [ + ":C = 'France'" + ] + +[sheet] + columns = [ + ":A", + ":C", + ":source-target.A", + ":source-target.C", + ] diff --git a/examples/importer.toml b/examples/importer.toml index 08e9e25..a8ee199 100644 --- a/examples/importer.toml +++ b/examples/importer.toml @@ -1,23 +1,25 @@ +dataset = "dataset.toml" + [source] - file = "financial.xlsx" name = "source" + # The file is looked up in the dataset -[externals.target] +[externals.source-target] intern_key = ":source.A ^ '-suffix'" extern_key = ":A ^ '-suffix'" - file = "financial.xlsx" allow_missing = false + # The file is looked up in the dataset [externals.a_financial] - intern_key = ":target.A" - extern_key = ":O" # This key is here to generate errors + intern_key = ":source-target.A" + extern_key = ":O" file = "financial.xlsx" allow_missing = false [sheet] columns = [ - ":target.A ^ '\\''", # Ensure the quote is escaped before sending to the sql engine - "join('-', :A, :target.E, :B)", + ":source-target.A ^ '\\''", # Ensure the quote is escaped before sending to the sql engine + "join('-', :A, :source-target.E, :B)", ":C", "counter([:C], [:A])", "sum(:F, [:B, :C, :D], [:B])", @@ -40,4 +42,3 @@ ] sort = [] - uniq = [] diff --git a/examples/importer_groupe.toml b/examples/importer_groupe.toml index eb2f7e6..ea2c7de 100644 --- a/examples/importer_groupe.toml +++ b/examples/importer_groupe.toml @@ -1,15 +1,12 @@ -# Cet exemple permet de montrer la combinaison de fonction de groupe avec des -# filtres. +# This file show how the groups can be used in filters. +# +# We search for the greatest value of units sold in France. In order to get the +# expected result, we need to filter first the country in France before +# looking for the greatest value. -# 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 +dataset = "dataset.toml" [source] - file = "financial.xlsx" name = "source" [sheet] |