Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

filtering script

Hello,

Y have a residents tables with differents filters that works fine... but when I try to filter by month and vendor doesn´t work.

I need to filter one vendor called 'Vendor3' and this vendor doesn´t have to appear in January, February and March.

So I have this:

RentaVariable:

Load *

From <>

;

Ingresos:

Load*

From........

CONCATENATE (Ingresos) LOAD

  mes_renta,

  vendedor_desc_renta,

  linea_desc_renta,

  tipo_doc_renta,

  'Zona Norte' as Ingresos

RESIDENT RentaVariable

WHERE wildmatch(vendedor_desc_renta,'Jorge Carrizo','Mario Troncoso','Nestor Morales','Paolo Rivera','Bladimir Gonzalez','Roberto Mendez');

CONCATENATE (Ingresos) LOAD

  mes_renta,

  vendedor_desc_renta,

  linea_desc_renta,

  tipo_doc_renta,

  'Gerencia de Ventas - Ingeniería' as Ingresos

RESIDENT RentaVariable

WHERE wildmatch(vendedor_desc_renta,'Vendor1','Vendor2','Vendor3')

////( Here is my problem)//////

first solution:

And If(mes_renta = 'ene' or mes_renta = 'feb' or mes_renta = 'mar' and vendedor_desc_renta = 'Vendor3',monto_actual_renta=0,monto_actual_renta)

Second Solution:

And If(mes_renta = 'ene' and vendedor_desc_renta = 'Vendor3', monto_actual_renta = 0, monto_actual_renta)

Third Solution:

And If(mes_renta = 'ene' or mes_renta = 'feb' or mes_renta = 'mar', vendedor_desc_renta <> 'Vendor3',vendedor_desc_renta)

Nothing Happens,

How can I filter and try to do disappear that vendor 3 in the ene feb mar period?

Thanks!

1 Solution

Accepted Solutions
maxgro
MVP
MVP

to exclude Vendor 3 for 3 months

adapt to your months, mine is just a text

load * inline [

vendedor_desc_renta, mes_renta

Vendor1, gen

Vendor1, feb

Vendor1, mar

Vendor1, apr

Vendor1, mag

Vendor2, gen

Vendor2, feb

Vendor2, mar

Vendor2, apr

Vendor2, mag

Vendor3, gen

Vendor3, feb

Vendor3, mar

Vendor3, apr

Vendor3, mag

]

Where

  not (vendedor_desc_renta='Vendor3' and Match(mes_renta, 'gen', 'feb', 'mar'))

  ;

View solution in original post

6 Replies
maxgro
MVP
MVP

to exclude Vendor 3 for 3 months

adapt to your months, mine is just a text

load * inline [

vendedor_desc_renta, mes_renta

Vendor1, gen

Vendor1, feb

Vendor1, mar

Vendor1, apr

Vendor1, mag

Vendor2, gen

Vendor2, feb

Vendor2, mar

Vendor2, apr

Vendor2, mag

Vendor3, gen

Vendor3, feb

Vendor3, mar

Vendor3, apr

Vendor3, mag

]

Where

  not (vendedor_desc_renta='Vendor3' and Match(mes_renta, 'gen', 'feb', 'mar'))

  ;

pgalvezt
Specialist
Specialist
Author

CONCATENATE (Ingresos) LOAD

  mes_renta,

  vendedor_desc_renta,

  linea_desc_renta,

  tipo_doc_renta,

  'Gerencia de Ventas - Ingeniería' as Ingresos

RESIDENT RentaVariable

WHERE wildmatch(vendedor_desc_renta,'Vendor1','Vendor2','Vendor3')

and not (vendedor_desc_renta='Vendor3' and Match(mes_renta, 'gen', 'feb', 'mar'))

Thanks!!

Inline not was needed

maxgro
MVP
MVP

inline was needed in my script to check the answer and give an example as I don't have your data

pgalvezt
Specialist
Specialist
Author

Nice!

Thanks!!

Massimo one question?

If I want that condition for '2015' period just added and match(año_renta = '2015') is that right?

What Happen if I want to left that vendor just for (año_renta = '2015' and just 'ene' , 'feb' , 'mar') ?

maxgro
MVP
MVP

if you want the vendor3 with anno 2015 and month gen, feb, mar

and (vendedor_desc_renta='Vendor3' and Match(mes_renta, 'gen', 'feb', 'mar') and año_renta = 2015)

if you don't want (exclude the same vendor, anno and months), just add a not

and not (vendedor_desc_renta='Vendor3' and Match(mes_renta, 'gen', 'feb', 'mar') and año_renta = 2015)


año_renta = 2015

is the same as

match(año_renta , 2015)


pgalvezt
Specialist
Specialist
Author

Thanks Again...