Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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

Regards

Ashish Srivastava

Not applicable
Author

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
Partner - Creator II
Partner - Creator II

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
Author

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
Creator III
Creator III

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
Author

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
Author

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
Partner - Creator II
Partner - Creator II

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
Author

Hi Manish,

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

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