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: 
rulohx87
Contributor III
Contributor III

Bubble Sort in QlikView

¡Hey!

I would like use this code in an expression. Which are the functions? There are a "FOR" or "WHILE"?

This code is Java.

Codigo

int A[] = {20,10,50,70};

int Aux= 0;

   for(int i=0; i < A.length-1; i++)

    {

      System.out.println("  EMP: "+i+" "+A);

         for(int j = 0; j < A.length-i-1 ; j++)

           {

                   System.out.println("J: "+j+" "+A);

                   f(A[j+1] < A )

                        {

                                Aux = A[j+1];

                                A[j+1] = A;

                                A = Aux;

                         }

              }

     }

11 Replies
jerem1234
Specialist II
Specialist II

Maybe you would be able to use something like:

pick(match(rangemax(sum(V1), sum(V2), sum(V3)), sum(V1), sum(V2), sum(V3)), 'V1', 'V2', 'V3')

Replace V1, V2, ... with your pictures.

Just be careful when you have 2 sums that are the max, will pick the first one in list.

Just to clarify, V1, V2, ... are separate fields right?

Hope this helps!

rulohx87
Contributor III
Contributor III
Author

Thank you.