Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community Team,
I have requirement like below
I wanted to show top 10 countries by button
I created a Pivot table in that dimension is Country and expression1 - sum(sales), expression2 - sum(sales1) - expression 2 used for only sorting and its hidden in presentation tab.
so, once I click on button then top 10 countries should show.
Please help me.
Hi Priya,
I tried a different approach and it is working for me.
Please find the attached qvw hope it will help you.
Thanks,
Harika
You can create an expressions which is conditional based on the value of a variable.
If(vVar = 0, Sum(Sales), Sum({<Country = {"Rank(Sum(Sales)) <=10"}>} Sales))
Your button will have an action which set vVar to be =If(vVar = 0, 1, 0)
I hope this helps.
Best,
Sunny
here you have an example
more
Hi Sunindia,
thank for reply. could you please brief about it.
My requirement is.
Dim: Country Expression: Sum(Sales)
India 20000
Brazil 19000
US 18000
Canada 16000
Kenya 15000
France 60000
UK 5000
Germany 3000
so,
Now, in my 1st button action should be - top 3-- so once I click on it then India, Brazil, US should display in Chart
like that I have top4 button etc....
Thank for reply Enrique.
My requirement should be display by button like below
Dim: Country Expression: Sum(Sales)
India 20000
Brazil 19000
US 18000
Canada 16000
Kenya 15000
France 60000
UK 5000
Germany 3000
so,
Now, in my 1st button action should be - top 3-- so once I click on it then India, Brazil, US should display in Chart
like that I have top4 button etc....
So you want a button that on the first touc will give you top3, on the second - top 4 and so on?
Yes,
but separate button like 1st button - top3 countries and second button top4 countries.
My requirement should be display by button like below
Dim: Country Expression: Sum(Sales)
India 20000
Brazil 19000
US 18000
Canada 16000
Kenya 15000
France 60000
UK 5000
Germany 3000
so,
Now, in my 1st button action should be - top 3-- so once I click on it then India, Brazil, US should display in Chart
like that I have top4 button etc....
Please find attached:
Minor edit to the expression: If(vVar = 0, Sum(Sales), Sum({<Country = {"=Rank(Sum(Sales)) <=10"}>} Sales))
Best,
Sunny
button action select in field
search action ='$(v)'
variable v ='(' & concat(if(aggr(Rank(Sum(sales)),country)<=3,country), '|') & ')'