Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
ben0109
Contributor III
Contributor III

Rank all occurrences of a repeating field

Hi

I have a table that contains client numbers and dates when changes that were made to their profiles. The intention is to add a number next to each row that will act as a 'history tracker' and that can be used as a restore point if needed.

The table below shows the outcome I want to achieve:

ClientDate changedRank/occurrence
Client A2010-10-011
Client A2020-01-012
Client B1990-05-241
Client C2017-01-171
Client C2017-08-012
Client C2018-01-083
Client C2020-06-184

 

Please let me know if you need more information.

Thanks in advance for your help!

Labels (2)
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this way

LOAD Client,
[Date changed],
AutoNumber([Rank/occurrence], IterNo()) as Rank
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Rank-all-occurrences-of-a-repeating-field/m-p/177015...]
(html, codepage is 1252, embedded labels, table is @1);

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

2 Replies
Anil_Babu_Samineni

Try this way

LOAD Client,
[Date changed],
AutoNumber([Rank/occurrence], IterNo()) as Rank
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Rank-all-occurrences-of-a-repeating-field/m-p/177015...]
(html, codepage is 1252, embedded labels, table is @1);

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

ben0109
Contributor III
Contributor III
Author

Hi Anil

Thank you for your response. The problem is that the field, Rank/Occurrence, is not in the table data. I want to create this in the load script or as a dimension/measure within Qlik Sense.

However, I simply changed the Rank/occurrence to the date field and that seemed to have done the trick.

Thanks again for your help.