Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Excluding fields from a table

Hi

I want to exclude certain values in a table.

For eg , In the Category table below , I want to excluded PRICE , LOA & REPORT GROUP .  How do I do the scripting ?

Category
TV & VIDEO
TORCHES
AUDIO OBSOLETE
LOA
APPLIANCES
BATTERIES
BRACKETS
CABLES
CABLE MANAGEMENT
CCTV
CLEANING KITS
CABLE SOLUTIONS OBSOLETE
COMPUTER NETWORKING
DISPLAY STANDS
ELLIES OBSOLETE
ELECTRICAL
ENERGY MONITORING
ELECTRICAL OBSOLETE
GENERATORS
PRICE
HDMI
HEADPHONES
REPORT GROUP
HOME SECURITY
INDUSTRIAL AUDIO
INVERTERS
LIGHTING
MULTIMEDIA
NETWORKING OBSOLETE
OUTDOOR OBSOLETE
PACKAGING
PORTABLE DEVICES
RAW MATERIALS ENGINEERING
REMOTE WORLD
SANWARE
SATELLITE
SHELVING
SIGNAL DISTRIBUTION
SATTELITE OBSOLETE
SOLAR
TELEPHONE
WIND POWER
14 Replies
lucasvallinoto
Contributor

Re: Excluding fields from a table

Nayan,

If you want to do this on the Script, you could use the inner join:

//Example

// To keep only Category

// TV & VIDEO

// TORCHES

// Use

inner Join ( FullTab )
SelectedValues:
LOAD * INLINE [
Category
TV & VIDEO
TORCHES
]

Hope I Could Help

Re: Excluding fields from a table

Hi

Try like this

Load If(not wildmatch(Category, 'PRICE' , 'LOA','REPORT GROUP'), Category) as Category from tablename;

Hope that helps

Not applicable

Re: Excluding fields from a table

thanks.  Will try and let you know.

carlos_reyes_qv
Valued Contributor

Re: Excluding fields from a table

It's just the same as Mayil suggested but in the case you want to load more fields than Category from the same table, you should move that condition to the WHERE clause:

LOAD

          Category,

          Field2,

          Field3

FROM TableName

WHERE NOT MATCH (Category, 'PRICE' , 'LOA','REPORT GROUP')

;

Not applicable

Re: Excluding fields from a table

Hi,

    PFA

sbobbyraj
Contributor III

Re: Excluding fields from a table

Hi,

You can do that like this:

 

LOAD

     Category
FROM

     XXX

Where

Category<>'PRICE'

AND

Category<>'LOA'

AND

Category<>'REPORT GROUP'

;

Not applicable

Re: Excluding fields from a table

Hi All

Thanks for all the responses.  The actual model i have a a bit more complicated.  I'll try the formulae given and give feedback.

kind regards

Nayan

Not applicable

Re: Re: Excluding fields from a table

Hi

The formula dont seem to work.  What I have done is created an extract of my database in excel.

Below  are 5 items with main category and sub category (I've also attached an excel file)

Also attached is a list of main Categories and Sub-Categories.

In the table below i dont want to lines if the  Main Category Code = PRICE, REPORTGRP or LOA .  How do i do the scripting. For each item there should be only one line.

Just to let you know, on our database for Main Category Code equal to:

  • PRICE  - the Sub Category Code is a any value    (see excel file attached)
  • REPORTGRP - the Sub Category code B/O, WPU, wpu , WPY and also blank
  • LOA - the Sub Category code is blank.

Your help would be appreciated.

kind regards

Nayan


Item and Categories.jpg

Not applicable

Re: Excluding fields from a table

Hi

The formula dont seem to work.  What i have done is create an extract of my database in excel.

Below  are 5 items with main category and sub category (I've also attached an excel file)

Also attached is a list of main Categories and Sub-Categories.

In the table below i dont want to lines if the  Main Category Code = PRICE, REPORTGRP or LOA .  For each item there should be only one line.

Just to let you know, on our database for Main Category Code equal to:

  • PRICE  - the Sub Category Code is a any value    (see excel file attached)
  • REPORTGRP - the Sub Category code B/O, WPU, wpu , WPY and also blank
  • LOA - the Sub Category code is blank.

Your help would be appreciated.

kind regards

Nayan


Item and Categories.jpg

Community Browser