Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hamy_IT_Dev
Contributor II
Contributor II

How to write window function (dense rank) in QlikView?

How to write window function (dense rank) in QlikView

Ex:

SELECT *
FROM
(SELECT *, last_value(cte1.DensRank) OVER (PARTITION BY OfficeName,OfficeGroup,[Month],[Week] ORDER BY OfficeType ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING ) as MaxValue
FROM
(SELECT *,
dense_rank() OVER (PARTITION BY OfficeName,OfficeGroup,[Month],[Week] ORDER BY OfficeType) as DensRank
FROM tblOffice) cte1) cte2
WHERE
(cte2.MaxValue >= 3 AND OfficeGroup= N'Fruit')
OR
(cte2.MaxValue >= 2 AND OfficeGroup = N'Rice')
ORDER BY OfficeName,OfficeGroup,[Month],[Week], OfficeType

1 Reply
Anil_Babu_Samineni

Check https://community.qlik.com/t5/QlikView-Documents/Continuous-Ranking-no-missing-Rank/ta-p/1486407

 

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful