Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional list boxes

Hi everybody,

I have some problems understanding how to make my conditional list box work.

What I have is this: a list box with all the countries(when I select a country, or more, all the tables in my report show data for that country).

I also have another list box with the currency (which always has EUR, USD and LOCAL). All the data in the report can be evaluated, for every country, at any moment, in any of those three currencies.

When no country is selected (so I have the data aggregated for all countries), the user wants to see it evaluated only in EUR or USD(so in the "Currency" list box I'd have only EUR and USD).

But when I select a country, I need to have the possibility to select the currency between EUR, USD and LOCAL (so now all this 3 values have to be visible in the list box).

I tried to do this by using a conditional in the "Currency" list box, that looks like this: =if(IsNull(GetFieldSelections(Country)),Currency<>'LOCAL', Currency)

But when currency is <>'LOCAL', in the "Currency" list box I get the values "-1" and "0".

Does anybody have any idea why is that?

Or how can I do this in a different way?

Thanks a lot!

Smaranda

1 Solution

Accepted Solutions
danielact
Partner - Creator III
Partner - Creator III

Try creating the variable (let's call it vCountry) as =GetSelectedCount(Country)

Then use the following in your list box:

If(vCountry=0,if(Currency<>'Local',Currency),Currency)

View solution in original post

8 Replies
israrkhan
Specialist II
Specialist II

Hi,

Show All Currencies in list Box,

create a variable, and assign selected currency to that variable,by using GetcurrentField(Currency)

you can restrict user to select one at a time. when user will select any currency that will be in variable.

then in the expression do Multiple your value by Variable, which has selected currency, and multiple or divide by conversion rate.

and you can put label of your expression like,  Amount in & GetcurrentField(Currency)

it will show you the label as Amout in USD, or any selected currency..

Hope it Clear.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Try

=if(GetSelectedCount(Country) = 1 or Currency <> 'LOCAL', Currency)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi,

Thanks for your answer!

I tried it, and it works if i have no country selected (the list box only shows me USD and EUR).

When I select a country I have all three currencies in the list box.

The problem is that when i select one of those currencies, it reselects me ALL of the countries and the list box goes back to having only EUR and USD.

Thanks!

Not applicable
Author

Hi there,

Thanks for the answer!

I made the list box and created the variable but then i didn't quite understand how to use the variable that gets me the current selection in Currency with the list box.

Could you be a little more specific, please?

Thanks a lot!

Smaranda

Not applicable
Author

Hi Smaranda,

Hope either of the below options helps!

1. =if(GetSelectedCount(Country)<1, if(Currency <> 'LOCAL',Currency),if(GetSelectedCount(Country)>=1,Currency))

2. =if(GetSelectedCount(Country)<1 and Currency<>'Local',Currency,if(GetSelectedCount(Country)>=1,Currency))

--

Vinoth

Not applicable
Author

Hi,

I tried your formulas but neither of them worked.

I already had the variable that got me count of selected countries but wasn't able to use it properly neither way.

1. Using the first formula in the list box, it got me only EUR and USD when no country was selected, but when i selected one of those 2 currencies, it automatically selected me all countries in the "country" list box and at the same time made visible all three currencies in the "Currency" list box.

2. The second one didn't even get me only USD and EUR, but all three currencies when no country was selected.

I'll try doing it again tomorrow, with a clearer head i hope

Thanks a lot for the help!

Smaranda

danielact
Partner - Creator III
Partner - Creator III

Try creating the variable (let's call it vCountry) as =GetSelectedCount(Country)

Then use the following in your list box:

If(vCountry=0,if(Currency<>'Local',Currency),Currency)

Not applicable
Author

Hey Daniel,

Thanks a lot! It was so easy and i was so close i can't believe it!

Thanks again for your help!

Wish you a really nice day!

Smaranda