When a table has thirty columns and you want the eight that begin with q, naming them is tedious and goes stale the moment a ninth arrives. pick where takes a question about a column’s name instead.
name is the word for whichever column is being considered. There are three tests you can ask about it, starts, ends and contains, and they join with and, or and not like any other condition.
Error:
!
illegal: no column's name matches that, so this would leave the table with no columns. It has: respondent, q1_score, q2_score, region
|
2 | then pick where (name starts "zzz")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
try: collect(survey >> pick(where(name.starts("zzz"))))except GodError as refusal:print(refusal)
illegal: no column's name matches that, so this would leave the table with no columns. It has: respondent, q1_score, q2_score, region
|
2 | then pick where (name starts "zzz")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^