How to select values in one table based on variable from another table in QlikSense?
I have two tables,
They are linked by CustomerID. I have created a variable input Sales = StoreSales
and I want to display a table with the relative frequency of the occurence of the stores based on the variable Sales. So suppose I have selected Sales>3000
, my table will look like this:
But if I use the condition =if(round([StoreSales])>=$(Sales), StoreName)
in my table, I get null values in my table. Where am I going wrong/what am I missing? Are my tables not linked? Or is it because I have repeating CustomerIDs for the same store name?
Take a look at the table I've created for you. Your expression is =if(round([StoreSales])>=$(Sales), StoreName) returning nulls because you are not telling it what to do with the true values. A count() aggregation would fix that.
The other piece you need is the 'all' modifier so that you can determine the percentage you want by dividing the individual store count by the total number of sales above the threshold.
Different threshold