- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Return "True" or "False" if multiple columns contain string
Hi,
I would like to return "False" if any column data contains "hello" else return a "True"
I am only able to process 1 column with if, any ideas?
10 REPLIES 10
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Return "True" or "False" if multiple columns contain string
I assume this is what you are looking for
You have already been basically provided answer for this, pick "correct" "formula" (these do not evaluate dynamically) and add additional check for "hi"
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
New Column("Column 1", Character, "Nominal", Set Values({"hello", "bye", "bye"})),
New Column("Column 2", Character, "Nominal", Set Values({"hello", "bye", "bye"})),
New Column("Column 3", Character, "Nominal", Set Values({"hello", "hello", "bye"})),
New Column("Column 4", Character, "Nominal", Set Values({"hello", "a hello a", "bye"})),
New Column("Column 5", Character, "Nominal", Set Values({"hello", "bye", "bye"}), Set Display Width(75)),
New Column("Column 6", Character, "Nominal", Set Values({"hello hello hi", "hi hi hi hi", "bye"}))
);
dt << new column("C", numeric, continuous, formula(
If(Row() == 1,
dt = Current Data Table();
rangelow = 1;
rangehigh = 6;
);
res = Filter Each({val}, dt[Row(), Index(rangelow, rangehigh)], Contains(val, "hello") | Contains(val, "hi"));
N Items(res);
));
-Jarmo
- « Previous
-
- 1
- 2
- Next »