Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
This works:
FIRSTSORTEDVALUE(TOTAL <customer, part_number> dim_from_B, AGGR(SUM({<$(vSetfromB)>}$(vValuefromB)), customer, part_number, dim_from_B))
Thanks for the previous reply from stalwar1!
Don't see anything which looks wrong in the first look... would you be able to share a sample where this isn't working....
also, you can try to add DISTINCT to see if that helps
FirstSortedValue(DISTINCT dim_from_B, -aggr(sum({<$(vSetfromB)>}$(vValuefromB)), customer, part_number,dim_from_B) )
This works:
FIRSTSORTEDVALUE(TOTAL <customer, part_number> dim_from_B, AGGR(SUM({<$(vSetfromB)>}$(vValuefromB)), customer, part_number, dim_from_B))
Thanks for the previous reply from stalwar1!