# Qlik Sense Cloud Discussions

Highlighted
New Contributor III

## Ranking Toggle

Hello Group!

I have the formula below which allows me to see bottom individual customer names based on sales growth (negative growth in this case) for product xxx.  The number of bottom accounts is controlled by a cyclic expression. I would like to add a toggle which will allow me to switch between individual customer name and IDN, and I can use a cyclic dimension for that. Cyclic dimension 1 = IDN, 2 = individual customer name. I thought I could simply replace [Individual Customer Name] below with if cyclic dimension =1 then IDN otherwise individual customer name. This doesn't seem to be working. Any help would be greatly appreciated.

Thank you.

=
IF(
AGGR(
RANK(
-
(
SUM({\$<
[Fiscal Month]=,
[Fiscal Year]=,
[Fiscal Quarter]=,
[Fiscal MonthYear]=,
[Calendar.Date]=,
[Minor SubCategory] = {'xxx'},
[Fiscal Year]={"\$(=max([Fiscal Year]))"},
[Fiscal Month Number] = {"<\$(=max({<[Fiscal Year]={\$(=max([Fiscal Year]))}>} [Fiscal Month Number]))"}
//[Nth Day of Fiscal Quarter]={"=\$(=maxstring([Fiscal QuarterYear])) [Nth Day of Fiscal Quarter]))"}
>}NetSales
)
-
SUM({<
[Fiscal Month]=,
[Fiscal Year]=,
[Fiscal Quarter]=,
[Fiscal MonthYear]=,
[Calendar.Date]=,
[Minor SubCategory] = {'xxx'},
[Fiscal Year]={"\$(=max([Fiscal Year])-1)"},
[Fiscal Month Number] = {"<\$(=max({<[Fiscal Year]={\$(=max([Fiscal Year]))}>} [Fiscal Month Number]))"}
>}NetSales
)
)
) <= \$(cyclic expression)
,[Individual Customer Name]
)
,[Individual Customer Name]
)