Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

SQL to QV convert

Hi Community,

I have below query and need to convert to QV.

SELECT

row_number() over(partition by contract_ref order by contract_ref) AS "Row #",contract_ref

from Table;

Data would come like this

contract_ref - Row #

1 - 1

1 - 2

2 - 1

3 - 1

3 - 2

3 - 3

4 - 1

I have to create dimension for "Row #", pls can someone share ideas.

_priya

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Data:

Load *,RecNo() as Recno inline

[

A

1

1

2

3

3

3

4];

LEFT JOIN ([Data])

LOAD

Recno

,if(A=previous(A),peek("Row Number")+1,1) as "Row Number"

RESIDENT [Data]

ORDER BY A DESC

;

DROP FIELD Recno

;??

View solution in original post

1 Reply
Anonymous
Not applicable

Data:

Load *,RecNo() as Recno inline

[

A

1

1

2

3

3

3

4];

LEFT JOIN ([Data])

LOAD

Recno

,if(A=previous(A),peek("Row Number")+1,1) as "Row Number"

RESIDENT [Data]

ORDER BY A DESC

;

DROP FIELD Recno

;??