Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

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

MayilVahanan

Hi

Try like this

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

Hope that helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

thanks.  Will try and let you know.

Carlos_Reyes
Partner - Specialist
Partner - Specialist

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
Author

Hi,

    PFA

Anonymous
Not applicable
Author

Hi,

You can do that like this:

 

LOAD

     Category
FROM

     XXX

Where

Category<>'PRICE'

AND

Category<>'LOA'

AND

Category<>'REPORT GROUP'

;

Not applicable
Author

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
Author

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
Author

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