Replacing one value in a field with another value for records that match
I think I must be approaching this problem in the wrong way but ..
I have a table which contains a numeric value. I want to replace all occurences of the number 1 with the number 0 for all record where this field currently contains the number 1. I have, so far, found this impossible to do. Ninox wants to replace any record which has the number 1 anywhere within it. What am I doing wrong ?
There are a couple of ways that I know of. You can use "Update Multiple Records", select "Assign calculated value" and use this formula...
if NumberField = 1 then
number(replace(text(NumberField), "1", "0"))
You can attach this code to a Button or run it in the Console...
for r in select YourTable do
if r.NumberField = 1 then r.(NumberField := 0) end
You are actually right about that.
The correct regex would be:
However, Ninox cannot do a 'positive lookbehind' in this case.
The "" in replace(extractx(title, "(?=\<)(.*?)(?=\>)"), "<", "") does not create a space , but replaces the < character with 'nothing', so removes the < character.