Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

siva_boggarapu
Contributor II

How to remove '--'(special character) from the field?

Hello There,

I have a table where I need to exclude '--' which is not a null. Could you please advice how to fielter.         

11 Replies

How to remove '--'(special character) from the field?

Hi,

You need to use the subfield command to exclude this type of symbols from the data.

Regards,

Anand

chauhans85
Esteemed Contributor

How to remove '--'(special character) from the field?

may be this one

Load *

from path where columnname<>'--';

How to remove '--'(special character) from the field?

Hi,

You need to write some thing like this code

=Subfield(ColA,'-',1) to exclude the symbol '--' from any data from the load script or any of the object level you are able to do that.

Reagrds

Anand

Re: How to remove '--'(special character) from the field?

Hi,

See the attached sample for clearity it is ok for you.

Reagrds

Anand

How to remove '--'(special character) from the field?

Hi,

In load script you need to write some thing like this

Temp:

load * inline

[

ColA

asasasfs--

dddd--

ddd----

fsfsf----

];

load

Subfield(ColA,'-',1) as CleanField

 

Resident Temp;

or in object level you need to put Subfield(ColA,'-',1) on any object like list box any other object

Regards

Anand

Re: How to remove '--'(special character) from the field?

Hi,

You need to do some changes in your load script or in onject level where ever you want it

put this code if you want to exclue from data like

ColA

fdfd

fdgdg

---

--

sads

Just put

If(ColA>Len(Chr(196)),ColA)

And if you want to remove it from any data which is like

ColA

ColA

asasasfs

dddd

dd

dffa----

fsfsf

dasds--

dasa-----------

www

rrrrr

If(ColA>Len(Chr(196)),Subfield(ColA,'-',1)

See the attached sample file 

Regards

Anand

Re: How to remove '--'(special character) from the field?

Hi,

If you got correct answer so mark it correct so other will not try it.

Regards

Anand

Highlighted
harleen_singh
Contributor III

How to remove '--'(special character) from the field?

Hello siva.boggarapu

                                use the PurgeChar (string,'-') function like this

if ur field or string is abc--cde

PurgeChar('abc-cde','-')

it will give output abccde.

thanks

Lavi

How to remove '--'(special character) from the field?

Hi,

If there are several types of symbols in the tring and you want to remove it you are able to remove it by the use of Purgechar( ) command like

If string are like

ColA

sdasdasd----

asd---dsds

----sds

you have to put Put a code like =Purgechar( ColA, ' - ' )

or if string are like

ColA

sdasdasd----

asd---dsds

----sds

---(((fdfd

you have to Put a code like =Purgechar( Purgechar( ColA, ' - ' ), ' ( ' )

if there is any type of symbol acording to that you have to use it.

Regards,

Anand