Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
khchoy
Partner - Creator
Partner - Creator

Can I use a view when using the target_lookup function?

Can I use a view when using the target_lookup function?
I'm trying to insert a target time into a specific column using a transformation using the following view, which retrieves the target time, but I keep getting errors.
The view is as follows:

CREATE OR REPLACE FORCE EDITIONABLE VIEW CDCADM.TIMENOW
(CURR, CURR_TIME)
BEQUEATH DEFINER
AS
select '1' as CURR, sysdate as CURR_TIME from dual;

I used target_lookup as follows:

target_lookup('NO_CACHING', 'CDCADM', 'TIMENOW', 'CURR_TIME', 'CURR=1','' )

I tested but I met error as follow:

00004367: 2025-10-30T13:39:28:837380 [TARGET_APPLY ]T: Data lookup statement for table 'CDCADM.TB_TIME' was not found in the pool, going to allocate a new statement (statement_manager.c:2151)
00004367: 2025-10-30T13:39:28:839568 [TARGET_APPLY ]T: Failed to rebind parameter for data lookup [1020402] (oracle_endpoint_unload.c:1566)
00004367: 2025-10-30T13:39:28:839685 [TARGET_APPLY ]T: Failed to get data lookup statement for table CDCADM.TB_TIME [1020402] (oracle_endpoint_unload.c:1675)
00004367: 2025-10-30T13:39:28:839744 [TARGET_APPLY ]T: Cannot read from stream [1020102] (streamcomponent.c:2289)
Regards,

KwangHo

Labels (3)
6 Replies
OritA
Support
Support

Hi KwangHo, 

The documentation of the target lookup function refers only to tables. I am not sure if views will work. Anyway, you did not mention what is the endpoints that are involved. In some endpoints there are limitations related to usage of views. I suggest you open a case with your issue and attach to the case the task diagnostic package so we can clearly see all the setting and the details about the involved endpoints and the way the transformation rule was written so we can furhter check this point. 

Thanks & regards,

Orit

 

khchoy
Partner - Creator
Partner - Creator
Author

Hi,

Thanks for answer.

I tested with table but I met same error. 

Regards,

Kwang Ho

khchoy
Partner - Creator
Partner - Creator
Author

Hi,

I solved this problem.

Reason is simple that target_lookup do not allow special characters in column name.

I used "_" in column name.

Also target_lookup  support table or view.

Regards,

Kwang Ho

john_wang
Support
Support

Hello Kwang Ho, @khchoy ,

Not sure if I understood you correctly.

The underscore (“_”) in the column name isn’t a special character, so it shouldn’t be the cause of the issue. At least we can see that the first parameter in the lookup expression already includes an underscore:

target_lookup('NO_CACHING',...

Regards,

John.

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!
khchoy
Partner - Creator
Partner - Creator
Author

Hi John,

I tested again. You are rigjt. 

when I met error , I did not set 'COND' and COND_PARAMS of target_lookup parameters,

I tested  with two kind;

1, target_lookup(0, 'CDCADM', 'TIMENOW', 'CURR_TIME','',$COL_KEY )

2. target_lookup('NO_CACHING', 'CDCADM', 'TIMENOW', 'CURR_TIME','CURR<>:1',$COL_KEY )

case 1 met error but case 2 is OK..

Thank you for pointing out my mistake.

Regards,

Kwang Ho

 

john_wang
Support
Support

Thank you so much for your outstanding support! @khchoy 

Help users find answers! Do not forget to mark a solution that worked for you! If already marked, give it a thumbs up!