Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

kikerodriguez10
New Contributor III

Where clause with 2 variables.

Hi everyone!

I need to use two variables in a where clause. I try with this syntax but I did not succeed:

Let vVariable1=5;

Let vVariable2=10;

Table:

Load Field1,

         Field2,

         Field3

From Document

WHERE Field1 > $(vVariable1)  and  Field1 < $(vVariable2);



Anyone know the correct syntax for this example?



Thanks in advance!



5 Replies
vishsaggi
Esteemed Contributor III

Re: Where clause with 2 variables.

Try this

Let vVariable1=5;

Let vVariable2=10;

Table:

Load Field1,

         Field2,

         Field3

From Document

WHERE Field1 > '$(vVariable1)' and  Field1 < '$(vVariable2)';

kikerodriguez10
New Contributor III

Re: Where clause with 2 variables.

Thanks for your help @Vishwarath Nagaraju !

I tried it but did not work, also I tried with double quote but neither work.

Any other syntax?

Thank you very much!

devarasu07
Honored Contributor II

Re: Where clause with 2 variables.

Hi,

Seems like some data format issue . can you share some mock data and expected output. that would be easy for us to check and share our suggestions. Thanks

Thanks,
Deva

vishsaggi
Esteemed Contributor III

Re: Where clause with 2 variables.

What are the values you hold in your Field1 column? Can you share some sample data to look into. ?

Employee
Employee

Re: Where clause with 2 variables.

It seems correct to me, unless Field1 has a different format