Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

priyarane
Contributor III

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

1 Solution

Accepted Solutions
laddu_927
Valued Contributor

Re: SQL to QV convert

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

;??

1 Reply
laddu_927
Valued Contributor

Re: SQL to QV convert

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

;??

Community Browser