Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
sculptorlv
Creator III
Creator III

Adding place numbers in scrip

Hello!

I have the following code:

SORTED_MANAGERS:

     LOAD

          Employee,

          Points,

     

     RESIDENT FINAL_POINTS

     ORDER BY

            Employee,

            Points DESC

;

How can I modify this LOAD statement in order to get an extra column NPK with number 1,2,3 and so forth for Employees with better Points result?

NPK          Employee          Points

1               Janis                    54

2               Jonh                     47

3               Sara                     34

.....

 

Thank you in advance!

1 Solution

Accepted Solutions
sculptorlv
Creator III
Creator III
Author

I needed to change the sequence of Ordered columns.

Thank you for help!!

LOAD

RecNo() as NPK,

          Employee,

          Points,

   

     RESIDENT FINAL_POINTS

     ORDER BY

          Points DESC,           

          Employee

           

;

View solution in original post

4 Replies
sasiparupudi1
Master III
Master III

  LOAD

RecNo() as NPK,

          Employee,

          Points,

    

     RESIDENT FINAL_POINTS

     ORDER BY

            Employee,

            Points DESC

;

sculptorlv
Creator III
Creator III
Author

I guess it gives number for none sorted values :

NO.jpg

stigchel
Partner - Master
Partner - Master

Something like this?

FINAL_POINTS:

Load * Inline [Employee,Points

Jonh,47

Sara,64

Janis,54

];

SORTED_MANAGERS:

Load Rowno() as NPK,*;

     LOAD

          Employee,

          Points

     RESIDENT FINAL_POINTS

     ORDER BY Points DESC

;

DROP Table FINAL_POINTS;

sculptorlv
Creator III
Creator III
Author

I needed to change the sequence of Ordered columns.

Thank you for help!!

LOAD

RecNo() as NPK,

          Employee,

          Points,

   

     RESIDENT FINAL_POINTS

     ORDER BY

          Points DESC,           

          Employee

           

;