Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI all.
I have a straight table like this:
In Expression column (in set analysis), I have to use the text of the corresponding country (on the same row). How could I do?
Thank a lot.
luca
The 'If' version can be:
Count(DISTINCT If(Country=ALT_COUNTRY, CITY))
Not sure what you are trying to achieve. The text of corresponding country is another field in the same table as Country, with a 1:1 relationship?
Then try
=Only( YourTextOfCorrespondingCountryField )
as expression.
Try =Only([Country (Dim)])
many thanks for reply.
I've tried, in set analysis
{< FIELD = {'$(=Only(Country))'} >}
{< FIELD = {"$(=Only(Country))"} >}
{< FIELD = {$(=Only(Country))} >}
and don't work..
luca
Why do you think you need to use a set analysis expression? Please explain what you're trying to achieve. What's the source data and what is the result table you want to see.
You don't need to filter by Country, as the dimension does that for you, If you want to create some text using the Country value you can directly use the field:
='This country is ' & Country
my expression is something like
= count ( distinct {< ALT_COUNTRY = {'$(=Only(Country))'} >} CITY )
where COUNTRY and ALT_COUNTRY are in separate tables with no link and have common value. I can't use ALT_COUNTRY as dimension.
The set is calculated at the chart level, not the row level. That means you cannot use set analysis here. You have to use an if statement. But a better solution is to fix your data model.
That should work, as long as there is only one possible value of Country (for example, a single selection), It will ignore the set expression if there is more than one possible country.To track multiple country selections:
= count ( distinct {< ALT_COUNTRY = P(Country)>} CITY )
Edit: I mean one global possible value, not just in a table row. As GW says, you can't do this on a row by row basis, but I am assuming that you are applying a single filter for all rows and Country is not associated with ALT_COUNTRY or CITY.
And QV field names are case sensitive COUNTRY <> Country