Discussion Board for collaboration on QlikView Scripting.
I'm don't know if QlikView can solve this problem, but any guidance would be great.
I have a table that looks like this:
I need logic that dynamically ranks so that it looks like this:
field1 field2 rank
I can guarantee sort order of field1 and field2. The business needs dictate that this must happen in the script.
Go to Solution.
If the field2 is already sorted in the rank they should be as it seems to be the case here - this script should do:
The AutoNumber with the second parameter given to separate the groups of field1 will count a sequence independently resulting in the Rank you seem to need...
Resulting in this:
You'll need to use Peek() in your script.
Something along the lines of
IF (Peek('field1')=[field1], Peek('fieldctr')+1, 1) as fieldctr
fieldctr gets reset to 1 every time field1 changes.
Hope that helps.
Works like a charm. Thanks