Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
ET_FixEx_RIVA_HSBC1
Contributor II
Contributor II

Qlik Replicate Filter Expression

Hi everyone,

I wanted to apply the below filter on replicate but dont know whats the correct syntax for that , can someone help me on this

select * from CMS_BDR_AGG_GROUP where keysum not in (select distinct '%X'||agg_id||'X%' as keysum from CMS_REF_AGG where (agg_type=3 and NAME='HBCA') OR (agg_type=2 and NAME like '%HBCA%')) ;

MSSOT_RIVA_HSBC1_0-1710822642487.png

MSSOT_RIVA_HSBC1_1-1710822844065.png

 

Labels (3)
3 Replies
john_wang
Support
Support

Hello @ET_FixEx_RIVA_HSBC1 ,

Thanks for reaching out to Qlik Community!

May we know if this is a Full Load ONLY task, or the filter will be used during CDC stage?

If it's a Full Load ONLY task then the easiest way is create a VIEW in source database (and filter the data by using the VIEW), and replicate the VIEW in Qlik Replicate task. It's much easier in Replicate task design/maintenance and better performance during run time.

Hope this helps.

John.

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

Hi John , Thanks for helping here we need to apply the filters in CDC stage. We are unable to modify the source database. Please advise of a solution.

Heinvandenheuvel
Specialist III
Specialist III

That request appears to be beyond the direct Replicate transformation functions.

Replicate easily can do a convoluted  'CASE - this that or the other thing' but the IN clause suggest infinite/not-predefined cases. Maybe a smart RANGE filter can help if the cases are limited.

I suspect you best, slow, bet is to let the source handle it.

Use a transformation (filter) using source_lookup(TTL,SCHM,TBL,EXP,COND,COND_PARAMS) with something along the lines of 

source_lookup(0,<schema>,'CMS_REF_AGG', 'count(1)' ,' (:1=3 and :1='HBCA') OR (:1=2 and :2 like '%HBCA%'))', $agg_type, $NAME)

If the returned count is 0, then it is 'NOT IN' 

Hein,