Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pauledrich
Creator
Creator

Creating a Number in script

Hi & thanks for any help on this one.

I have the need to create a 10 digit number based on two fields - one field is always static at 4 digits and the other is a transaction ID.

So I would like to create one in the script known as 'ItemCode' the format would look something like:-

<4 digits><Padding><TransID>

Regards

P

8 Replies
bbi_mba_76
Partner - Specialist
Partner - Specialist

Hi,

maybe with

<4 digits>&right('000000'&<TransID>,6)

Not applicable

Hi Paul,

You may try Column1 & Column2 , this should append both of your values.

Thanks,

Sai

pauledrich
Creator
Creator
Author

Hi Thanks - Still learning the craft.... where would this be placed in the script as I get a syntax error...

I am using

Load

Field1 & Right ('000000' & Field2,6) as ItemCode

pauledrich
Creator
Creator
Author

Thanks - I had thought of that, I want the string to be no longer and no less than 10, so 1234000012.

1234 = (Field1 Value)

0000 = (Padding - which will need to reduce as trans number increases)

12 = (Field3 Value)

P

Not applicable

Hi Paul,

Can you try this:

ID &0000& Left(Value,2)

Thanks,

Sai

angelaecheverri
Creator
Creator

Try Text(Field1&Right(('000000'&Field2),6))

if you want to use  '-' between will be something as:

Text(Field1&'-'&Right(('000000'&Field2),6))

Not applicable

Paul,

Try creating an expression with the above value and display it in the required chart or may be a variable.

Thanks,

Sai

bbi_mba_76
Partner - Specialist
Partner - Specialist

In the attachment you could find an example.