We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This works:
open wallet-lt.csv | filter timestamp { take 10 | >= $cutoff-date } | let {nth 0 get:Num fiat-value} $start {last get:Num fiat-value} $end | Table $name | append-row { \$end | - $start } | append-row { \$end | / $start | - 1 } | let $t | open executions-lt.csv | filter timestamp { take 10 | >= $cutoff-date } | filter real = 'true' | append --ret-val { let #i.buy-fiat:Num $s | get sell-fiat | - $s } | grp coin | append --sum { get value | fold 0 {:Num + $row.ret-val } } | sort 'sum' | let $cs | \$t | append-row { \ $cs | if {empty} '' { last get:Str key } } }
However, if we abstract the last line into a definition:
def def-if-empty (t:Table d e:Expr) { \ $t | if {empty} $d $e } def summary-col (name:Str cutoff-date:Str) { open wallet-lt.csv | filter timestamp { take 10 | >= $cutoff-date } | let {nth 0 get:Num fiat-value} $start {last get:Num fiat-value} $end | Table $name | append-row { \$end | - $start } | append-row { \$end | / $start | - 1 } | let $t | open executions-lt.csv | filter timestamp { take 10 | >= $cutoff-date } | filter real = 'true' | append --ret-val { let #i.buy-fiat:Num $s | get sell-fiat | - $s } | grp coin | append --sum { get value | fold 0 {:Num + $row.ret-val } } | sort 'sum' | let $cs | \$t | append-row def-if-empty $cs '' { last get:Str key } }
There is a runtime error saying that the column key is not present.
key
This is either a locals issue or an input issue, but the last call is not being invoked on the correct table.
last
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current Behaviour
This works:
However, if we abstract the last line into a definition:
There is a runtime error saying that the column
key
is not present.This is either a locals issue or an input issue, but the
last
call is not being invoked on the correct table.The text was updated successfully, but these errors were encountered: