I have a text field
Possible contents are A , B and AB
I want to count all records that have A, and all that have B, so I would like to add
- a virtual field A, that is 1 if the string contains an A
- a virtual field B, that is 1 if the string contains an B
```
$A = ifThenElse(
string\contains('$field', 'A') // will return true
1, // return this value
0 // otherwise, this
)
$B = ifThenElse(
string\contains('$field', 'B') // will return true
1, // return this value
0 // otherwise, this
)
```
In this way I can use those in a report (and export)
What workarounds do we have?
Possible contents are A , B and AB
I want to count all records that have A, and all that have B, so I would like to add
- a virtual field A, that is 1 if the string contains an A
- a virtual field B, that is 1 if the string contains an B
```
$A = ifThenElse(
string\contains('$field', 'A') // will return true
1, // return this value
0 // otherwise, this
)
$B = ifThenElse(
string\contains('$field', 'B') // will return true
1, // return this value
0 // otherwise, this
)
```
In this way I can use those in a report (and export)
What workarounds do we have?
Comment