Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Find Number within Text

hi......

I have to FIND only number within the text, from both fields below, and compare it and if it doesn't match then gives "error".

This is the formula I used in excel: =ISNUMBER(FIND(Sheet1!D2,Sheet1!C2))

I tried =If(Num(ResponCatCode)<>Num(ResponsiveCategories), 'Error')

But its not working properly

Is there any script I can use…

for example if responsiveCategories has "4-.... " and if ResponCatCode says "2-..." it should say error

ResponsiveCategories

ResponCatCode

4-Communication regarding Enron financial issues

2-Communication between Enron and its auditors - reference to such communications

2-Communication between Enron and its auditors - reference to such communications
4-Communication regarding Enron financial issues



13 Replies
Not applicable

Hi,

see the attached example for an idea. In the QlikView help file you will find more information about "String Functions".

Good luck!

Rainer

justinasp
Creator
Creator

Hi,

one workaround that I think of could be:

=IF(KEEPCHAR(ResponCatCode,'0123456789')<>KEEPCHAR(ResponsiveCategories,'0123456789'),'FALSE')


Justinas

renjithpl
Specialist
Specialist
Author

Thanks a lot Justinas, it worked........ 🙂

renjithpl
Specialist
Specialist
Author

it really helped me to understand some thing more about strings... thanks a lot

justinasp
Creator
Creator

That what this forum is for!

Good luck,

Justinas

renjithpl
Specialist
Specialist
Author

Hi Justinas,

Is there any option for me to find the character individually,

as per your example.

KEEPCHAR(abcd1agc2egee3, '0123456789') returns 123

I would be greatful if you could tell me some method where it returns 1, 2, and 3 separately. it should not read as one hundred twenty three.

Thanks.

justinasp
Creator
Creator

Hi,

you shoul try to experiment with some "String functions". For example:

=MID(vTest,FINDONEOF(vTest,'0123456789', [write number here]),1)
=MID(KEEPCHAR(vTest,'0123456789'), [write number here], 1)
and so on..

Cheers,

Justinas

renjithpl
Specialist
Specialist
Author

hi...

can you tell me whats vTest, and what it does, its showing bad field name.

Thanks...

justinasp
Creator
Creator

Hi,

vTest is a name for a field or variable. In your case it should be ResponCatCode or smth.

Take care,

Justinas