3 Replies Latest reply: Nov 2, 2015 3:47 PM by Jacob Anderson RSS

    Dynamic Sorting in the Script

    Jacob Anderson

      Hello All,

       

      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:

       

      field1        field2

      AAAZZZ
      AAAYYY
      AAAXXX
      BBBWWW
      BBBVVV
      BBBUUU
      BBBTTT
      CCCSSS
      CCCRRR
      CCCQQQ
      CCCPPP
      CCCOOO
      CCCNNN
      CCCMMM
      CCCLLL
      CCC

      KKK

       

      I need logic that dynamically ranks so that it looks like this:

       

      field1        field2          rank

      AAAZZZ1
      AAAYYY2
      AAAXXX3
      BBBWWW1
      BBBVVV2
      BBBUUU3
      BBBTTT4
      CCCSSS1
      CCCRRR2
      CCCQQQ3
      CCCPPP4
      CCCOOO5
      CCCNNN6
      CCCMMM7
      CCCLLL8
      CCCKKK9

       

      I can guarantee sort order of field1 and field2.  The business needs dictate that this must happen in the script.

       

      Any suggestions?