Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
NBen15
Contributor II
Contributor II

increment value of column

Hello,

I have an excel file that contains data(tFileInputDelimited), I have to create a column that contains a value that increments by 10 for each product:

here is the input file

product | sub_product

product 1 | sub_product 1

product 1 | sub_product 2

product 1 | sub_product 3

product 2 | sub_product 5

product 2 | sub_product 6

here is the output file:

product | sub_product | incremental_value

product 1 | sub_product 1 | 10

product 1 | sub_product 2 | 20

product 1 | sub_product 3 | 30

product 2 | sub_product 4 | 10

product 2 | sub_product 5 | 20

in this case in each time we have a new product we increment by 10. I try to use tJava and tJavaRow bu i can't do this.

Can you help me please

Labels (2)
1 Solution

Accepted Solutions
gjeremy1617088143

it's normal you have to use one sequence for each product

so if product is a String data :

 

for eg : if your main input is row1 and the input field is product

Numeric.sequence(row1.product,10,10)

View solution in original post

4 Replies
gjeremy1617088143

Hi, sequence can help you , for eg in the tmap output field you want to increment :

Numeric.sequence("s1",10,10)

 Send me love and kudos

NBen15
Contributor II
Contributor II
Author

@gjeremy1617088143 Thanks for your feedback

I have already tried this solution but it increments all the fields to 10, I get 10,20,30,.... even if I change product.

 

gjeremy1617088143

it's normal you have to use one sequence for each product

so if product is a String data :

 

for eg : if your main input is row1 and the input field is product

Numeric.sequence(row1.product,10,10)

NBen15
Contributor II
Contributor II
Author

@gjeremy1617088143 it works very well thank you very much