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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SQL query output and passing a default value to the output

Dear's,

 

I have a requirement , in which i have a sql query  and i need to classified the output to default value ex:-TEST

The sql query has one column and it  will fetch me 100 rows with different  id's

Now once i get the output i need to pass a default value 'TEST' to that column

 query  is : select * from table where id<=5 , i need to pass this query and generate output as below

ex: if the query gives me 5 rows , With different values like below

 

ID

1

2

3

4

5

 

My output should be 

ID

TEST

TEST

TEST

TEST

TEST

 

Basically i need to classify  using the query .

how shall i do it using talend?

 

Please help will be appreciated.

 

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hi Ami,

 

It sounds like you want to mask your data. You have two ways:

 

1. Your mapping. A tMap will typically map the input_row.id --> out_row.id. Your mapping expression can be a constant. So out_row_id can be simply mapped to a constant "TEST".

2. You can also explore the Data Masking features available in Talend, very flexible and versatile. Watch this video for a quick demo:

 

https://www.youtube.com/watch?v=YTl8IgaoZv8

 

If you want your value to be a parameter, check how to use Context variables here:

 

https://help.talend.com/display/TalendOpenStudioforESBUserGuide60EN/3.4.1+How+to+define+context+vari...

 

HTH

Gene

 

TRF
Champion II
Champion II

Just try to replace your query by this one:

select 'TEST' as ID from table where id<=5

 

Regards

TRF

Anonymous
Not applicable
Author

Thanks , was thinking on similar lines , we will try this and intimate you bro!
Anonymous
Not applicable
Author

Thanks for the reply surely i will try out this
Anonymous
Not applicable
Author

Dear,

I want to implement this as a incremental job ,
i want to incrementally pull data from the below query

to Take the unique ID from schema_name.table_name where ID like ‘11%’

I have never used incremental in talend .
Can you give me steps to build one job ?
Many Thanks,
Amit