Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

nihhalmca
Valued Contributor II

IF Condition - Like Operator

Hi All,

Need your help.

I want to implement logic at back end. for example. Field name is Gaap/Non-Gaap it has values like

Gaap/Non-Gaap

Gaapxyz

Gaap 123

.

.

up to 100 values

Non-Gaapxyz

Non-Gaap 123

.

.

Up to 150 values

xyz

123

And my requirement is i want to make these many values as 4 values

value 1: where ever 'Gaap' text is there consider as Gaap

value 2: where ever 'Non-Gaap' text is there consider as Non-Gaap

value 3: xyz

value 4: 123

Result should be

Gaap/Non-Gaap

Gaap

Non-Gaap

xyz

123

For all i know, have to use LIKE operator (WildMatch) in IF condition.

Regards,

Nihhal.

1 Solution

Accepted Solutions

Re: IF Condition - Like Operator

Hi

Try like this

Load *, Pick(WildMatch(Gaaps, 'xyz', '123', '*Non-Gaap*', '*Gaap*', '*'), 'xyz', '123', 'Non-Gaap', 'Gaap', Gaaps) AS NewGaaps;

Load * Inline

[

Gaaps

Non-Gaapxyz

Non-Gaap 123

Gaapxyz

Gaap 123

xyz

123

sdfs

];

View solution in original post

7 Replies
MVP & Luminary
MVP & Luminary

Re: IF Condition - Like Operator

Hi Nihhal,

Try like this

LOAD

*,

If(Pick(WildMatch(FieldName, '*xyz*', '*123*', '*Non-Gaap*', '*Gaap*', '*'), 'xyz', '123', 'Non-Gaap', 'Gaap', FieldName) AS NewFieldName

FROM DataSource;


Regards,

Jagan.



Re: IF Condition - Like Operator

Hi

Try like this

Load *, Pick(WildMatch(Gaaps, 'xyz', '123', '*Non-Gaap*', '*Gaap*', '*'), 'xyz', '123', 'Non-Gaap', 'Gaap', Gaaps) AS NewGaaps;

Load * Inline

[

Gaaps

Non-Gaapxyz

Non-Gaap 123

Gaapxyz

Gaap 123

xyz

123

sdfs

];

View solution in original post

nihhalmca
Valued Contributor II

Re: IF Condition - Like Operator

Thanks for reply ramasamy.

It is working fine, however 'Preceding load is not require here.

Thank you.

Nihhal.

nihhalmca
Valued Contributor II

Re: IF Condition - Like Operator

Thanks for reply Jagan.

It is not working fine, due to IF condition.

Thank you.

Nihhal.

Re: IF Condition - Like Operator

Hi Nihal,

For understanding, used like that.

MVP & Luminary
MVP & Luminary

Re: IF Condition - Like Operator

Yes by mistake I typed If in the expression, otherwise it works.

Regards,

Jagan.

nihhalmca
Valued Contributor II

Re: IF Condition - Like Operator

Ok ramasamy.