Scatter plot chart qliksense with dynamic dimension and top 10
I have data of example below, in this data we have Country and City with Sales and Profit
My idea is to build a scatter plot with Sales against Profit. I would like use a button to select either Country or city so that the dimension of scatter plot based on user selection. Also, because there are too many record, I would like to display either top 5 Countries based their sales or top 5 City based on their sales.
I have no idea how to write the rank formula to get top 5 countries or top 5 city based on their sales. Also, how to write the formula to make the dynamic switch between top 5 Countries based their sales or top 5 City based on their sales with the use of button/variables. (I guess if statement?)