3 Replies Latest reply: Jul 31, 2018 7:19 AM by Felip Drechsler RSS

    Sorting based on Dual() in cross tab when duplicate records exist.

    Jahnavi Mahankali

      In the below data set, when put in a cross tab in Qliksense and sorted on profile ID by expression priority below is the result . It does not consider the sorting unless selected on a customer.

       

      If I use Dual function on Profile, in the below table , it modifies the value for profile.

       

      Is there any way I can sort this data set, by customer and by profile id sorted by priority.

       

      Cross tab.PNG

       

      Dataset:

       

      TEMP1:


      LOAD



      * inline [

      customer|profile|priority

      14368|41214|6

      14368|9055|1

      14368|41214|3

      14109|41214|6

      14109|41480|1

      14109|41370|2

      13339|9055|7

      4633|19018|7

      ] (delimiter is '|');

       


      NoConcatenate


      [DUAL]:


      LOAD

      customer,

      DUAL(TEXT(profile),NUM(priority)) as profile,

      priority


      RESIDENT TEMP1;



      NoConcatenate


      [ORIGINAL]:


      LOAD

      customer AS customer_orig,

      profile as profile_orig,

      priority as priority_orig


      RESIDENT TEMP1;


      DROP TABLE TEMP1;