Hello,
c variable is the result of an online REST API query.
c variable should be a table, but sometimes it’s a list because one or more rows have an extra column ( in this case is the fourth row).
I need (a function?) checking each row and if the row has 5 elements deleting the 5th element.
Please can you give a hint?
Cheers
Francisco
q)c
accountId
accountNameaccountCurrency
marginRate!(1125870f;“Primary”;“EUR”;0.05)
accountId
accountNameaccountCurrency
marginRate!(9244246f;“Bull”;“EUR”;0.02)
accountId
accountNameaccountCurrency
marginRate!(6955195f;“Bear”;“EUR”;0.02)
accountId
accountNameaccountCurrency
marginRate`accountPropertyName!(1614502f;“MT4_EUR_Practice”;“EUR”;0.05;,“MT4”)
accountId
accountNameaccountCurrency
marginRate!(9995814f;“Coaching”;“EUR”;0.02)
q)type c
0h
q)count c
5
q)count (c 0)
4
q)count (c 1)
4
q)count (c 2)
4
q)count (c 3)
5
q)count (c 4)
4
q)-1#(c 0)
marginRate| 0.05
q)-1#(c 1)
marginRate| 0.02
q)-1#(c 2)
marginRate| 0.02
q)-1#(c 3)
accountPropertyName| “MT4”
q)-1#(c 4)
marginRate| 0.02
q)(c 3):4#(c 3)
q)type c
98h
q)c
accountId accountName accountCurrency marginRate
-------------------------------------------------------
1125870 “Primary” “EUR” 0.05
9244246 “Bull” “EUR” 0.02
6955195 “Bear” “EUR” 0.02
1614502 “MT4_EUR_Practice” “EUR” 0.05
9995814 “Coaching” “EUR” 0.02