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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Constants and SQL expressions in t_Map

How can I pass a constant in T_map component. I have to map 30 columns in source table and 40 columns in destination table. I map 10 columns directly, for some I have to perform expressions such as CASE WHEN column_name <> '' THEN column_name ELSE NULL, and sometimes I have to put in a constant sting or integer like '100' or 'test_value'. How can I achieve that?
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
Convert String or varchar to Integer: Integer.parseInt("123")
Convert Integer/int to String: String.valueOf(123)
Best regards
Shong

View solution in original post

8 Replies
Anonymous
Not applicable
Author

Hi
You can set the constants expression on tMap like this: condition?the value if true:the value if false, for example:
row1.columnName.equals("")?NULL:row1.columnName
Best regards
Shong
Anonymous
Not applicable
Author

Great thank you for the answer but what if I wanted to put in a string value into column using tMap without using expression? eg. 'text'
Anonymous
Not applicable
Author

Hi
Yes, you can type in a fixed string value in the expression field, eg: "text"
Best regards
Shong
Anonymous
Not applicable
Author

And one last thing how on earth can I convert string or varchar into integer before mapping? I have to map varchar column to column that is of type string
Anonymous
Not applicable
Author

Hi
Convert String or varchar to Integer: Integer.parseInt("123")
Convert Integer/int to String: String.valueOf(123)
Best regards
Shong
Anonymous
Not applicable
Author

Thank you very much for Your help. I know that these question may seem stupid but I naver used this component thouh it's one of the most basic ones.
Regards
Bro
Anonymous
Not applicable
Author

I have mapped two tables connected to each other with fk. The situation looks like this:
Employee_id of table employees has been generated from sequence on insert
Employee_id in salary table has to be filled in from Employees table joined on personal insurance number mapped from csv input.
Both mappings are done in one job Employees have insert order 1 and salary has order 2 how can I map the employees_id ? Do I need to add anothe PostgreSQL_input or can it be done inside tMap by usin "SELECT employee_id from employees emp where emp.insur_no = row1.columnName"?
Anonymous
Not applicable
Author

I have mapped two tables connected to each other with fk. The situation looks like this:
Employee_id of table employees has been generated from sequence on insert
Employee_id in salary table has to be filled in from Employees table joined on personal insurance number mapped from csv input.
Both mappings are done in one job Employees have insert order 1 and salary has order 2 how can I map the employees_id ? Do I need to add anothe PostgreSQL_input or can it be done inside tMap by usin "SELECT employee_id from employees emp where emp.insur_no = row1.columnName"?

Hi
For better management, one topic for one question, please report a new topic for your new question with details.
Thanks for your support!
Best regards
Shong