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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
bhagyarekha
Creator II
Creator II

one record to be split into two records

hi all

i have one record with following data

input

ID           CODE          PRICE

123         C2345           500   

 

now i need to make two records from it

c2345==2345:5678 (this code am having in my sheet  i need to compare the sheet and generate it)

 

output

ID         CODE     PRICE

123         2345          499
123        5678              1

 

 

Thanks&regards

bhagyarekha

Labels (2)
8 Replies
akumar2301
Specialist II
Specialist II

How did you split the price column ?

bhagyarekha
Creator II
Creator II
Author

That is main price minus one
akumar2301
Specialist II
Specialist II

Assuming that , you have another sheet with data like

 

CODE         MAPEDCODE

C2345         2345:5678

 

in tMap , do a join between two sheet,so that output of tmap will be

 

ID           CODE              PRICE

123        2345:5678           500

 

the use tNornamise  - Code 

 

ID           CODE              PRICE

123        2345                    500

123        5678                    500

 

Now on tJavaRow ,

output_row.ID=input_row.ID

output_row.CODE=input_row.CODE

output_row.PRICE = input_row.PRICE - Numeric.sequence(input_row.ID,0,1)

 

 

bhagyarekha
Creator II
Creator II
Author

Ya I have tried up to t normalize now I will add tjavarow and will update you.


Thanks for your time abhisheik
bhagyarekha
Creator II
Creator II
Author

Here am getting output in price column as 499 in both records.
I want 499 in one record and 1 in one record
akumar2301
Specialist II
Specialist II

sorry try this 

 

Integer seq = Numeric.sequence(input_row.ID,1,1) ;

output_row.ID=input_row.ID;

output_row.CODE=input_row.CODE;

output_row.PRICE = (seq == 1)?input_row.PRICE -  seq   :  seq - 1;

Anonymous
Not applicable

Hi,

 

    Could you please try below method?

0683p000009M4pK.png

 

The component details are as below.

0683p000009M4pP.png

 

0683p000009M4ed.png

 

0683p000009M4jm.png

 

0683p000009M4pe.png

 

0683p000009M4Yg.png

 

Please maintain the order of the tMaps as shown in picture. Instead of hard coding, you can even convert the value 1 with a context variable if the discount is different for each run.

 

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 🙂

Anonymous
Not applicable

@bhagyarekha 

 

Hope you were able to resolve your issue by one of the above methods.

 

If you do not have any outstanding queries, could you please mark the topic as resolved by marking the posts which helped you?

 

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 🙂