In Lil, the readcsv[] function takes an optional string specifying a type for each column to decode:
purchases:readcsv[read["purchases.csv"] "sii"]
sum purchases.amount
select first country sum amount by country from purchases
select first country sum amount-discount by country from purchases
stats:first import["stats.deck"] select first country sum amount-discount by country where amount<stats.median[amount]*10 from purchases
select first country sum amount-discount where amount<stats.median[amount]*10 by country from purchases
In Lil, the readcsv[] function takes an optional string specifying a type for each column to decode:
Summing a column: To create a summary, we need to reduce each group to a single row: Discounting: Lil doesn't have a "median" primitive. Decks can contain multiple modules, but we happen to know this one is alone. Your path will vary: Calculating the median within each group is merely a matter of reordering clauses: