Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Adding numbers to an scheme account.

Hi guys,

I got stuck in one scheme account's problem. Maybe someone could know easily how to do the following:

I have the following table with the number of the scheme account, the number of the account, and a flag which indicates if the account number has the maximum digits (in this case 7, but is completely dynamic).

error loading image

I want to create another table with the number of accounts which hasn't the max_length, and I want to add to them as many '0' (for minimum value) and as many '9' (for maximum value) as it would be necessary.

I did it in a static way :

Cuentas_Mayor5 :

load distinct

N_Fila as N_Fila2,

N_Fila_Cuenta&'0000' as N_Fila_Cuenta_Min,

N_Fila_Cuenta&'9999' as N_Fila_Cuenta_Max

resident Cuentas_Mayor4 where (Max_Length_Cuenta = 0);

And I got the desired result in the following table :

error loading image

I have in a variable the value of the maxLength. The point to do this is easy, it's just add as many '0' as the result of maxLength - len(currentCount), but I don't know how to do it in Qlikview.

Any help would be appreciated.

Thank you.

Cheers!!

1 Solution

Accepted Solutions
Not applicable

Hi,

Here you are a possible solution.

I hope it helps you.

Regards.

View solution in original post

2 Replies
Not applicable

Hi,

Here you are a possible solution.

I hope it helps you.

Regards.

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Muchas Gracias Miguel.

It was exactly what I was looking for : the function repeat ('something', 'n-times').

Very easy if you know exacty which function fits on your problem.

Thank you very much.

See you around!