Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

dynamic filter in script

Hi Folks,

i have a question:

my script does look like

load

ID,

Variante,

Category

from.....

Field: Category has only 2 Values: 1 and 2

i want to achieve a situation, where i load my dates where only Category = 1, I know i can solve that with: where Caterory = 1, but i want ti know whether is that makeable with variable:

is that possible with variable?

thanks a lot

beck

12 Replies
sunny_talwar

You can use variables... do you intend the user to decide if they want to pull Category 1 or Category 2?

laddu_927
Specialist
Specialist

Like

Variable = 0/1

Where Category = $(Variable)

or

Like

Variable = 'Caterory = 1'

Where $(Variable)

beck_bakytbek
Master
Master
Author

Hi Sunny,

thanks a lot for your feedback, yes, i want to indent to decide by users to pull Category between 1 and 2

beck_bakytbek
Master
Master
Author

Hi Shiva,

thanks a lot for your feedback, can i do that dynamicly?

sunny_talwar

Create a variable inputbox on the front end (lets call this vVar) and then use this in your where statement

LOAD ....

FROM ....

Where Category = $(vVar);

beck_bakytbek
Master
Master
Author

Sunny,

i have a question, can i create a query at the beginning of script like:

if vVar = 1 then

load

...

only Values with 1

and if vVar = 2 then

load...

only Values with 2

is that possible?

thanks a lot

sunny_talwar

I think you should be able to...

beck_bakytbek
Master
Master
Author

Thanks a lot Sunny

laddu_927
Specialist
Specialist

Yes Beck, You can use the Variable and pass values to it.