Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create new rows in a table in the script

Hi,

I have a challenging task that I would like to get your input to solve!

I am trying to create new rows with specific data dependent on a certain logic. Below I have tried to simplify what I am after.

I have the following tables:

transactions

product_idamountdate
1232002012-01-25
123-2002012-02-09

product conversion date

product_idproduct_conversion_date
1232012-02-05

If the "product_id" converts to another product I want the transactions to move to the new product type and I want the new transactions table to look like this:

transactions_new

product_idamountdateproduct
1232002012-01-25A
123-2002012-02-05

A

1232002012-02-05B
123-2002012-02-09B

Note: The product conversions are only from A to B so no logic is needed to termine that.

Any idéas how I can do this?

Cheers

Anna

1 Solution

Accepted Solutions
gandalfgray
Specialist II
Specialist II

Hi Anna

(assuming your first example transaction record has "product: A" and the second "product: B")

I did it with a loop over the product_conversion_date table.

There may be other ways as well.

see attachment!

View solution in original post

2 Replies
gandalfgray
Specialist II
Specialist II

Hi Anna

(assuming your first example transaction record has "product: A" and the second "product: B")

I did it with a loop over the product_conversion_date table.

There may be other ways as well.

see attachment!

Not applicable
Author

Thanks!!