Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Somewhat new to qlikview and I need to create a simple expression, saying that if a certain criteria is met (in this case, CountryName = 'USA'), then I want to count the distinct number of shipments coming out of that country.
I tried the following but it's not working:
=IF(CountryName = 'USA'),COUNT(DISTINCT(SHIPMENTS))
I want to make sure that the count I get is only for shipments coming out of the USA, not all shipments from all countries. What is the proper expression?
Thanks!
May be try one of these:
=If(CountryName = 'USA', Count(DISTINCT SHIPMENTS))
or
=Count(DISTINCT {<CountryName = {'USA'}>} SHIPMENTS)
May be try one of these:
=If(CountryName = 'USA', Count(DISTINCT SHIPMENTS))
or
=Count(DISTINCT {<CountryName = {'USA'}>} SHIPMENTS)
The second option worked. Thank you!
=Count(DISTINCT {<CountryName = {'USA'}>} SHIPMENTS)
Then the if alternative of the set analysis is this:
=Count(DISTINCT If(CountryName = 'USA', SHIPMENTS))