# App Development

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
Contributor

Hi Brains Trust,

I wonder if you can please help me with my formula. The formula in a field I have created is to find the letter D in one of the other columns in the set. In the new field put the word 'Dog' and for all other letters/numbers that appear, put an 'X'.

If (WildMatch([Animals]'D*')=1, 'Dog' [,else 'X'])

D = Dog, C = Cow, H = Horse, F = Fish, B = Bird

 Colour Animal Results (Formula above) Brown D, C, H Green F, B Black D, C, H, F, B

I have tried this formula but is still saying there is an error, can anyone shed some light on where I'm going wrong or what I could try?

6 Replies
MVP

HI @Bravo_B

Try like below

MapName:
[
A1, A2
D, Dog
C, Cow
H, Horse
F, Fish
B, Bird
];

Temp:
LOAD *, Trim(SubField(Animal,',')) as A1 INLINE [
Colour, Animal
Brown, "D, C, H"
Green, "F, B"
Black, "D, C, H, F, B"
];

Load Colour, Concat(ApplyMap('MapName', A1, 'X'),',') as Animal Resident Temp group by Colour;

DROP Table Temp;

Thanks & Regards,
Mayil Vahanan R
Contributor III

HI,

Do you have only 5 Vales or animals ?

D = Dog, C = Cow, H = Horse, F = Fish, B = Bird

or is there something apart from this ?

Contributor
Author

Hi there,

Yes, only 5 animals. It is part of something bigger, but I am just trying to work out the formula for this kind of scenario.

Thanks!

Contributor III

Hi ,

Could you please provide the result what you are expecting in other column.

Not sure i, completely understood the problem.

Thanks

Specialist

hi,

your formula will be like this

If (WildMatch([Animals],'D*'), 'Dog' ,'XX');

ksrinivasan

Specialist

hi,

If (WildMatch([Animal],'D*'), 'Dog' ,'XX');

Tags
Community Browser