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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
sam2000
Contributor II
Contributor II

How to dynamically map input columns to output columns

Hello,

As shown in image below, here is my input excel.0683p000009M9Kb.pngI want output as below:

0683p000009M9Kg.png

Here is my tMap:

0683p000009M9Kl.png

 

From the input excel, depending on the current quarter, I want to choose 3 columns. In the example given, I have shown I want to choose Apr, Mar, Jun i.e. Q2. However, in case of Q3, I need to choose Jul, Aug, Sep. Let's assume, I have 3 context variables that hold the month name depending on quarter.

context.month1="Apr-2019"

context.month2="May-2019"

context.month3="Jun-2019"

 

So, for this example, I want below mapping in tMap, as the three context variables contains those months:

C4 --> M1

C5 --> M2

C6 --> M3

However, this has to be dynamic; In the next quarter, it will be other set of 3 columns i.e. C7, C8, C9

Essentially, I want to remove those columns that are not required for current quarter.

I am using Talend Open Studio 7.2.1. Cannot use licensed version.

Any ideas appreciated. Thanks.

 

Labels (2)
1 Reply
Anonymous
Not applicable

Hi,

 

    Below blog describes about dynamic processing of data. It is not exactly same use case but it can give you an overall idea.

 

https://www.talend.com/blog/2019/10/31/magically-shuffle-columns-talend-dynamic-schema/

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved