Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How do I load only rows user needs today?

How do I load only rows user needs today?  I see how to load from a database using ODBC and SQL, but I do not see how to load only the data the user needs.   It may take an hour to load a year's worth of data.   Can a user set a start date that determines how much is loaded today?   I searched the forum but perhaps did not use the proper keywords to find this topic if it already exists.

1 Solution

Accepted Solutions

Re: How do I load only rows user needs today?

LET vStartDate = '2012-09-14'; //This date can be made whatever you want, but the date

                                             //must be in the same format that it is in SQL

Table:

LOAD Field1, Field2;

SQL SELECT

    Field1,

    Field2

FROM

    "YourSQLTable"

WHERE

    DateField in ('$(vStartDate)');   

5 Replies

Re: How do I load only rows user needs today?

LET vStartDate = '2012-09-14'; //This date can be made whatever you want, but the date

                                             //must be in the same format that it is in SQL

Table:

LOAD Field1, Field2;

SQL SELECT

    Field1,

    Field2

FROM

    "YourSQLTable"

WHERE

    DateField in ('$(vStartDate)');   

Not applicable

Re: How do I load only rows user needs today?

This answer works great for me.   I have a follow-on question.  I would like to see if there is a way I can offer the user a list of parameters and let them choose the parameters they want to use, then use their parameter list in the query.

Is there something similar to what you did above?  

Would the solution involve changing the $(v  for variable   to $(f  for field  ?  

Thanks,

Tom

Re: How do I load only rows user needs today?

You can offer them a list of parameters in variable form (check out input boxes for this).  The query would then be the same as what I have above minus the LET statement.  However, you have to remember that when they change what is in the variable, that won't be reflected automatically on the dashboard.  A reload needs to happen in order for this to be reflected.  If you are hosting the dashboard on a server, I don't think this will work.

Not applicable

Re: How do I load only rows user needs today?

Thanks,

Does this work if they are allowed to select more than one item? I thought a variable was for a single item.

Tom

Re: How do I load only rows user needs today?

You could have two variables (StartDate and EndDate) and do a load where LoadDate >= StartDate AND LoadDate <= EndDate.

*Note that what I have above is not correct syntax.

Community Browser