Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
sarsukanth
Contributor III
Contributor III

row_number(), over and partition by combination in Qlik Sense

Hi All,

I would like to know the equivalent Qlik Sense Scripting for below PL/SQL query part, so can anyone please assist me.

select
  id,
  zip,
  trans_date,
  row_number() over (partition by id, zip order by trans_date desc) a_rank
from
  Tbl_Hist

 

Thank you,

Raghu

Thank you,
Raghu
3 Replies
avinashelite

Try like this in the Qliksense 

 

Autonumber(id&zip) as a_rank

sarsukanth
Contributor III
Contributor III
Author

Thank you Avinash for your quick response

but it is ranking on total table and not individual combination of ID and ZIP by trans_date

so basically I need the a_rank like below

id | zip | trans_Date | Rank
1 | 25100 | 05/27/2021 | 1
1 | 25100 | 05/26/2021 | 2
1 | 25100 | 05/25/2021 | 3
1 | 32150 | 05/24/2021 | 1
2 | 45200 | 05/23/2021 | 1
2 | 45200 | 05/22/2021 | 2
2 | 63200 | 05/21/2021 | 1
2 | 63200 | 05/20/2021 | 2

Thank you,
Raghu
tresesco
MVP
MVP

Try like:

AutoNumber(RowNo(),id&zip) as Rank