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

Qlikview Search from List Box

Greetings

I have  field named DESCRIPTION (Long sentence)

The field will be typically looks like as follows

Example 1:

HS 25 , 5% MARGIN , LONG PATTERN EMBEDDED , PACKED IN 2KGS

Example 2:

HS-25, 15% Margin, LONG, Packed in 25KGS

EXAMPLE 3:

HS25, 20% MARGIN, PACKED in 10KGS

EXAMPLE 4:

LONG PATTERN, PACKED in 50KGS

EXAMPLE 5:

PLAIN WHITE, PACKED  20KGS

EXAMPLE 6:

BROWN FINISH, PACKED 10KGS

The Key words are HS 25, HS-25, HS25 and LONG. I need to find all the fields in table which matches the KEY Words. Example 5 and 6 is not matching.

How do I implement?

Thanks

20 Replies
Anil_Babu_Samineni

Because, Qlik script consider as field when we use like below "". You must use some thing like below

LOAD

    FILED1,

    FILED2,

    FIELD3,

    DESC,

    FIELDX

FROM

(ooxml, embedded labels)where DESC= 'HS25'; // Changed to Single Quote from Double quote

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks. Since  I am searching from the sentence for 'HS25' or 'HS 25' or 'HS-25' or 'LONG' , should it be changed something like   where DESC  like '%HS25%'  (This too not working )

Because When I changed to where DESC ='HS25' the script executes but 0 data found.

Anil_Babu_Samineni

I wonder, How qlik behaves going on in your application? will you able to provide sample application to check? I am sure, your application may secured from client prospect. So then we can freely ask Mock data for UAT? or you may doesn't have HS25 value for DESC ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks  Mr. Anil Babu

Appreciate all your help

I have  some dummy data for reference  https://goo.gl/vU6zDe

Here is the Load script

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='$#,##0.00;($#,##0.00)';

SET TimeFormat='h:mm:ss TT';

SET DateFormat='D/M/YYYY';

SET TimestampFormat='D/M/YYYY h:mm:ss[.fff] TT';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

SET FirstWeekDay=6;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='en-SG';

LOAD active,

    purchase_ok,

    rental,

    sale_ok,

    standard_price,

    sale_delay,

    ean13,

    default_code,

    produce_delay,

    mes_type,

    DESC,

    procure_method,

    type,

    list_price,

    supply_method,

    [Supplier/Supplier],

    [Supplier/Supplier Product Code],

    [Supplier/Supplier Product Name],

    [Supplier/Minimal Quantity],

    [Supplier/Delivery Lead Time],

    [Expense Account/Name],

    [Income Account/Name],

    [Supplier Taxes/Tax Name],

    [Customer Taxes/Tax Name]

FROM

(ooxml, embedded labels) where Match(DESC, 'HS25', 'HS 25' , 'HS-25' ,'LONG');

Once  again thanks a lot for your help.

Anil_Babu_Samineni

In your data the values are not separate values. Can you try like below

Load * from Table Where WildMatch(DESC, '*HS*','*LONG*');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks  Anil babu. Your suggestion work.

Anil_Babu_Samineni

Good, Can you close this thread by flag correct answer

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

In  addition to above If I need to exclude certain strings in Load statement is it possible

Suppose I want to exclude fields contains words like '*PR-32*',  '*SHORT*' in the above load statement.. How should I rewrite?

Anil_Babu_Samineni

This?

Load * from Table Where Not WildMatch(DESC,'*PR-32*','*SHORT*');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

This require  two  load for the same table.

But I want to achieve both.  i.e  INCLUDE  '*HS25*' and EXCLUDE '*PR-32*'