Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How I can do a Search with a variable on a List Box

Hi

I want to know how I can do a Search with a variable.

For example:

I Have a Variable call BaseDate = ‘1/1/2012’

I want to do a search on a list box DATE with the variable

>BaseDate

or

<= Basedate

Thanks,

14 Replies
Not applicable
Author

Does this is posible ..?

sebastiandperei
Specialist
Specialist

Do you want to select a value in a field? And want to get this value from a variable?

You could create a Button with an action that select a value in a field: (tell me if u don't know how)

- Field: {FieldName}

- Value: ='$(vS)'

Then, the value of vS:

='*'&'$(vSearch)'&'*'

Now, when you set the content of vSearch, and you push the button, in FieldName will be selected all values that contents the string set in vSearch.

Please, tell me if it was useful for you.

Not applicable
Author

If not too much to explain me how to do it.


Do i need to create a macro for this?

Thanks

sebastiandperei
Specialist
Specialist

Please, sorry if isn't the right terms, i have the spanish version:

- New Object: Button.

- Actions: Add

- Selection / Select value in field

- At the right window, you have 2 spaces: Field, Value. Write the next for each one:

Field:     {the field that contains the value you want to search}

Value:    ='$(vS)'

Go to Variable Panel (Ctrl+Alt+V)

- New Variable

- Write vS as the name of variable

- Select the vS variable

- In "Definition" write ='*'&'$(vSearch)'&'*'

Repeat for variable vS, but don't assign any value.

I was clear?

Not applicable
Author

No tengo ningún problema con el idioma español

Entonces:

Debo de crear dos variables

Una llamada vS ='*'&'$(vSearch)'&'*'

Y otra llamada vSearch ..?

Otra pregunta que tengo es en el campo de Field: va el nombre o el ID LB01

El campo que quiero usar la variable es uno tipo fecha

Gracias

sebastiandperei
Specialist
Specialist

jeje... buenìsimo.

Lo que te propongo es que tengas un cuadro de entrada, donde puedas ingresar el texto a buscar. Ese cuadro asigna la variable vSearch. Esta variable le da la info a vS, quien arma el string de búsqueda.

Con el botón, buscás el texto que ingresaste en el campo Field.... Fecha, ponele.

O sea, Fecha sería el campo que tiene los valores en los que buscàs el texto que contiene vString

Se entiende?

Not applicable
Author

Le entiendo su punto ..

Lo que deseo es lo siguiente:

Actualmente lo que tengo es una variable llamada BaseDate = Today(); la cual se ejecuta en el reload.

Esa variable la pienso usar en un calendario o un ‘Slider’ y me gustaría hacer búsquedas por el valor que tenga esa variable. Para así restringir los valores y que solo me muestren los que comienzan primero y no han terminado

Por ejemplo si selecciono

1 enero 2010 = VARIABLE

Y tengo  tres valores

Comienzo - Fin

1 enero 2009  - 1 feb 2010

1 feb 2010 – 1 mar 2010

1 feb 2009 – 1 feb 2010

Que solo me muestre el los que estén  START  < VARIABLE < FIN

sebastiandperei
Specialist
Specialist

En el ejemplo que escribís debería mostrar el primero y el último?

No comprendo si necesitás que la aplicación sólo muestre esos datos, la función del slider. Qué fechas se necesitan seleccionar?

Mil disculpas por mi mala comprensión

Not applicable
Author

Disculpa me confundi de Post

pero es algo similar a eso ..