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: 
carlospulgarinz
Contributor III
Contributor III

Count field Values

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:

 

NumeroCuenta
a1
a2
b1
b2
b3
c1
c2
c3
q1
q2
q3
q4
1 Solution

Accepted Solutions
maxgro
MVP
MVP

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; 

View solution in original post

4 Replies
Nicole-Smith

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;

maxgro
MVP
MVP

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; 

carlospulgarinz
Contributor III
Contributor III
Author

Thank you Massimo Grossi,

this worked!!

maxgro
MVP
MVP

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.