Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If Function with a special character

Hello,

Im having trouble with an If( Function in my Qlikview Load.

In the datafiles, its possible to select 'favorite' fields that are marked with a star symbol in the
Qlikview Logfiles. The character code for that star is: chr(9734)

2016-12-20_8-04-36.png

Now I want it to be possible that I delete the star symbol when its occurring in the table value.
I used an If( function like this: If(Wildmatch(Message, chr(9734)), PurgeChar(Message, chr(9734)))

But it didn't work.
Maybe its part of the If function or the Purgechar that wont work.

Anyone can help me with this issue?

Thanks in Advance!

Ivo

1 Solution

Accepted Solutions
Not applicable
Author

Thanks for all the replies guys!


I figured out how to solve my problem by using multiple Replace() functions.
That, because the original message line was "Chart: 'Star symbol' text.

I replaced the 'Chart: Star symbol' part, the 'Chart: ' part and the 'star symbol' part in this order.

Replace(Replace(Replace('_Chart: ☆ ',''), '_Chart: ', ''), '☆ ', '')  <- Like this

View solution in original post

10 Replies
Anil_Babu_Samineni

Do you mean, you want to delete Star from that list?

Update: Just use

PurgeChar(Message, chr(9734))

You can play round to achieve this

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
avinashelite

Or

replace(Message,chr(9734),'')

Not applicable
Author

Thanks for your reply

I've tried different things with the PurgeChar function, but it doesnt work...

I dont know if its because of the chr(9734) or something else.

Not applicable
Author

I really think it has to do with they function itself.

If I put in another character or line of text, it doesnt work either.

Gysbert_Wassenaar

Are you still using the Wildmatch function? If so you need to change that a bit:

If(Wildmatch(Message, '*' & chr(9734) & '*'), PurgeChar(Message, chr(9734)))

Otherwise you'll only get a match in Message contains only that star character and no other text at all.

The purgechar function works in a test here. If it doesn't work for you then perhaps the star character you see is not chr(9734) but another character.

You can also try the keepchar function: Keepchar(Message, '0123456789abcdef...etc...xyzABCDE....etc...XYZ')


talk is cheap, supply exceeds demand
vinieme12
Champion III
Champion III

Directly input as text

Example

purgechar('☆TODAY' ,'☆')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
varshavig12
Specialist
Specialist

PurgeChar() should work for you.

If it is still not working then as Gysbert said, it might be some other character.

Try using Vineeth's exp, i.e directly copy that character in your exp.

Not applicable
Author

Thanks for all the replies guys!


I figured out how to solve my problem by using multiple Replace() functions.
That, because the original message line was "Chart: 'Star symbol' text.

I replaced the 'Chart: Star symbol' part, the 'Chart: ' part and the 'star symbol' part in this order.

Replace(Replace(Replace('_Chart: ☆ ',''), '_Chart: ', ''), '☆ ', '')  <- Like this

vinieme12
Champion III
Champion III

Even this will work , purgechar(MESSAGE ,'_Chart: ☆')

No need for so many Replace()'s

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.