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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
DHazari1598547528
Contributor
Contributor

Need help to use globalMap's column name's VALUES in tMap Filter Expression.

We are using tMap for the following:

1. We are joining source and target table on key columns source.id= target.id

2. We are using globalMap to store the name of some columns for both the source and target.

3. Global Map contains the following values:

source_hash_column > hash_key

3. We want to use the column name stored in the globalmap, in the Filter Expression of tMap output.

(source.((String)(globalMap.get("hash_key")) == null)

4. Now issues are:

a) If we use it the way mentioned in point 3, it gives compilation error: Syntax error on token ".", Identifier expected after this token.

b) If we use concatenation like below, then its treating column names itself as String and Not the actual value stored in that column.

(source + "." + ((String)(globalMap.get("hash_key")) == null)

Can someone please suggest, how can we use globalMap's column name's values in tMap Filter Expression?

Labels (3)
21 Replies
DHazari1598547528
Contributor
Contributor
Author

Not sure though if it would just take that as a String or substitute it with the actual value within that col in the Filter Expression.

DHazari1598547528
Contributor
Contributor
Author

@Manohar B​ : I tried using the approach by having row2 concatenated in the globalMap value itself, but still it is just treating that value as a String in the Filter Expression and not substituting the actual value within that column.

manodwhb
Champion II
Champion II

@Deepti Hazari​ , I really not sure how you have designed and expecting to work. but i have create a simple job to check the globalvar filter in tMap. check the below one. it was working as expected.

 

 

 

 

Thanks,

Manohar

 

 

DHazari1598547528
Contributor
Contributor
Author

Thanks @Manohar B​ , but unfortunately i cant see the screenshot..can you please try to attach it again

manodwhb
Champion II
Champion II

@Deepti Hazari​ ,here is the job attached.

 

Please like and select as best the correct replay.

 

Thanks,

Manohar

DHazari1598547528
Contributor
Contributor
Author

Thanks a lot @Manohar B​ 

I think I got an idea from your attachement to fix my issue. But can you please suggest for this as well.

 

I can see in your tJavaRow code, you have used the below so that 1 row from the input to tJavaRow is mapped to its output.

"output_row.col1 = input_row.col1;"

 

So, what if I have many input columns and I want to do this for all the columns and get all the input columns mapped to the tJavaRow's output columns without writing the mapping for each column individually.

 

Can you please suggest a short design/ code statement for this?

 

 

 

 

 

manodwhb
Champion II
Champion II

@Deepti Hazari​ , Once you connect from previous component to tJavarow. click on Sync columns and then click on Generate code.what ever the columns you have in tJavaRow_1 output schema will generate automatically.

DHazari1598547528
Contributor
Contributor
Author

Thank you @Manohar B​ , yup even I thought about syncing col. Thanks for your time 🙂.

manodwhb
Champion II
Champion II

You are welcome @Deepti Hazari​ .

madhukolli2003
Contributor III
Contributor III

Hi @Deepti Hazari​ ,

I am having same issue to pass column as global variable in tmap and filter source data.

Can you please share how you have composed global variable and used it in tMap ?

 

@Manohar B​  -- Can you please share your job if you still have it, looks like it's delete from this ticket.

 

Thanks & Regards,

Madhu Kolli