Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Where condition when the data is loaded from sql statement

Hi All,


sql select
right('0000000000'+rtrim(cast(n_srno as varchar(10))),10)+c_doc_code as dwrkey,
c_item_code itemcode, n_product_unit sampleqty
from Tbl_DWR_Sub_Details where isnull(c_item_code,'')<>'';


If I want to concatenate the above dwrkey and itemcode as shown below then what will happen to the where condition which is there in the sql select statement.

I did some thing like the below one:


dwrsamples:
Load dwrkey & '|' & itemcode as %key,sampleqty;
sql select
right('0000000000'+rtrim(cast(n_srno as varchar(10))),10)+c_doc_code as dwrkey,
c_item_code itemcode, n_product_unit sampleqty
from Tbl_DWR_Sub_Details where isnull(c_item_code,'')<>'';


Let me know if I do like this what will happen to the where condition which is there in the sql statement. Will that where condition will not be executed? Please explain!

9 Replies
Not applicable

Where condition when the data is loaded from sql statement

I think isnull() function not support in sql server.

Regards

Ashish Srivastava

Not applicable

Where condition when the data is loaded from sql statement

Hi Ashish,

Thanks for you reply. I think you did not get my question right.

I am loading the data through the qlikview load statement instead of the sql statement. So just wanted to know what will happen to the where condition condition.

Does the load statement works only after the sql statement gets executed with the where condition. Please explain!

isnull() function is allowed in sql server and able to execute the query without any issues.

Do reply!

manishkumar75
Contributor II

Where condition when the data is loaded from sql statement

Hi,

Your where condition will work which you have written in the Sql Statement. Data will be loaded on the basis of the result from the Sql Statement.

Not applicable

Where condition when the data is loaded from sql statement

Hi Manish,

Thanks for your reply. So you mean to say that there is no need of writing where condition in LOAD statement again.

shumailh
Contributor III

Where condition when the data is loaded from sql statement

I couldn't understand why you are trying to do it in load statement? You can do the concatenation in SQL statement.

Regards,
Shumail

Not applicable

Where condition when the data is loaded from sql statement

Hi Shumail,

That's true that could have been done in the SQL statement itself. I just wanted to know when we are loading the data using the load statement does it loads the data from the sql statement or not. There is where condition there in the sql statement. So wanted to know do we need to write the where condition in the load statement also.

Not applicable

Where condition when the data is loaded from sql statement

Hi Shumail,

Do you have experience in working the loosely coupled. If you please help me out here.

http://community.qlik.com/forums/t/31125.aspx

manishkumar75
Contributor II

Where condition when the data is loaded from sql statement

Yeah, there is no need to write Where Condition in Load coz it will load only those values that returned from your Sql Statement.

Not applicable

Where condition when the data is loaded from sql statement

Hi Manish,

Thanks for your help. Can you please help me out here if you can.

http://community.qlik.com/forums/t/31125.aspx