1 Reply Latest reply: Jan 30, 2018 11:56 AM by Sunny Talwar RSS

    Retrieve the dimension based on the max of measure

    Ying Guo

      Hello there,

       

      I have struggled with this Qlik Sense chart expression for a few days and have not figured out how to write it. Hope you can help me: )

       

      I have a data table concatenating data set A  - revenue and data set B - opportunity. They both have 2 common fields - customer and part_number. I created a table that has customer and part_number as dimension, and a measure for revenue. I want grab a new dimension from data set B where it corresponda to the max of another measure for the same customer and part_number (sum({<$(vSetfromB)>}$(vValuefromB)) ). So below is the expression I wrote but only got null values:


      FirstSortedValue(dim_from_B, -aggr(sum({<$(vSetfromB)>}$(vValuefromB)), customer, part_number, dim_from_B) )


      Could you let me know where is wrong? Thanks a lot!