Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vongalaprashant
Contributor III
Contributor III

How to remove fields values ?

Hi All,

I have a query,

My table:

load * inline [

product,no

Sa,1

Sa-na,2

sa.no,3

no.sa,4

];

here I want to load only first data that is [Sa,1].i want to eliminate the rest from loading.

I was using where not match(product,' -na',' .no',' no') but it is not working.

I cannot use wildmatch because my data is case sensitive.

Any other function please help me:)

My result should be:

product,no

sa,1

6 Replies
rubenmarin

Hi prashanthi, you can use Index() or SubstringCount()

https://help.qlik.com/es-ES/qlikview/November2017/Subsystems/Client/Content/Scripting/StringFunction...

https://help.qlik.com/es-ES/qlikview/November2017/Subsystems/Client/Content/Scripting/StringFunction...

Note that 'no' also includes '.no', you can get many false positives is those are similar to the real data you wil use.

niclaz79
Partner - Creator III
Partner - Creator III

Where product = 'Sa';

Or do you need smarter logic than that?

vongalaprashant
Contributor III
Contributor III
Author

Hi Niclas,

There are so many field values in my data.I can not use your logic.

Can you help me  .

Thanks ,

prashanthi

chinnuchinni
Creator III
Creator III

try this :

if you want only 1st row you can use this below script.

abc:

First 1 load * inline [


product,no


Sa,1


Sa-na,2


sa.no,3


no.sa,4


];


EXIT SCRIPT;




if you want  to display only left 2 chars from Product you can use below script:

abc:

load * inline [

product,no

Sa,1

Sa-na,2

sa.no,3

no.sa,4

];

abc1:

load Left(product,2) as product1, no Resident abc;


DROP Table abc ;


EXIT SCRIPT ;

niclaz79
Partner - Creator III
Partner - Creator III

It gives you the expected result given the data you provided, can you clarify more what is the data you are using and what is the expected outcome.

Niclas Anderström

Mindcamp AB

niclas.anderstrom@mindcamp.se<mailto:niclas.anderstrom@mindcamp.se>

+46 702 39 21 43

Från: prashanthi reddy <qcwebmaster@qlikview.com>

Skickat: den 4 april 2018 10:54

Till: Niclas Anderström <niclas.anderstrom@mindcamp.se>

Ämne: Re: - How to remove fields values ?

sasiparupudi1
Master III
Master III

May be like

where SubstringCount(product,' -na',' .no',' no')=0


where (SubstringCount(product,'-na')=0 OR SubstringCount(product,'.no')=0 OR SubstringCount(product,' no')=0 )