Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
can someone help me with this?
I have this colum
Numero |
---|
a |
a |
b |
b |
b |
c |
c |
c |
q |
q |
q |
q |
and y need someting like this:
Numero | Cuenta |
a | 1 |
a | 2 |
b | 1 |
b | 2 |
b | 3 |
c | 1 |
c | 2 |
c | 3 |
q | 1 |
q | 2 |
q | 3 |
q | 4 |
Another option could be
Temp:
LOAD * INLINE [
Numero
a
a
b
b
b
c
c
c
q
q
q
q
];
Data:
LOAD Numero,
AutoNumber(Rowno(), Numero) as Cuenta
RESIDENT Temp;
DROP TABLE Temp;
In the load script, you can do something like this:
Temp:
LOAD * INLINE [
Numero
a
a
b
b
b
c
c
c
q
q
q
q
];
Data:
LOAD Numero,
IF(Numero = PREVIOUS(Numero), PEEK('Cuenta') + 1, 1) AS Cuenta
RESIDENT Temp;
DROP TABLE Temp;
Another option could be
Temp:
LOAD * INLINE [
Numero
a
a
b
b
b
c
c
c
q
q
q
q
];
Data:
LOAD Numero,
AutoNumber(Rowno(), Numero) as Cuenta
RESIDENT Temp;
DROP TABLE Temp;
Thank you Massimo Grossi,
this worked!!
Also Nicole's answer works.
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.