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: 
Anonymous
Not applicable

Tmap adding sequence number

Hi,

 

can i please request help on how to achive the below result using tmap

 

Input

A134

A134

A134

B235

B235

C129

 

Output

A134-01

A134-02

A134-03

B235-01

B235-02

C129-01

 

Thanks for your help.

 

Labels (2)
11 Replies
TRF
Champion II
Champion II

@rhall, you're right, you have to know the max expected length to decide if you need to add 10, 100, 1000 and so on.

From my point of view, this is the same when you use MyUtils.returnZeroPrePaddedNumber as you must decide how many leading 0 are expected.

The advantage of this routine is that there is no truncation when the input value is too large (but in that case the result is not exactly what is expected as soon as a fixed length is required).

Anonymous
Not applicable
Author

There is no perfect solution @TRF given the information we have. I just tried to make it a bit more flexible by setting a minimum length. The assumption being that numbers will not need to be truncated, but that you may always want at least 2 digits, for example.