CONCATENATE help with weird table structure

I have a legacy table with a strange data structure. Iโ€™m trying to make a virtual column but canโ€™t get it to work. I donโ€™t know if it because of the GEO table structure or simply because [Country_Geo_NO] can be a list, not just a single value. Letโ€™s assume that is the issue.

This is in another table. There can only be ONE Geo_NO per request. The [Country_Geo_NO] is based on the Geo_NO. There can be one or MORE [Country_Geo_NO] per request. I think that is where at least part of my problem is.

The expression below:

  1. only shows ONE [Country_Geo_NO], even when there are multiple.
  2. only shows the number and not the name. Iโ€™ve tried multiple ways but canโ€™t get the [Geo_Name] to show

CONCATENATE([Geo_NO].[Geo_Name], " โ€“ ", [Country_Geo_NO])

Thanks for pointing me to the right direction.

0 3 270
3 REPLIES 3

Bahbus
New Member

Even though I donโ€™t think this will work, try:

[Geo_NO].[Geo_Name] & " โ€“ " & CONCATENATE([Country_Geo_NO])

My thought is that there might be a bug with CONCATENATE and this, if it does work, would expose it.

Thanks. I must have missed something.

All three of these now produce the list of countries when there are more than one.

CONCATENATE([Geo_NO].[Geo_Name], " โ€“ ", [Country_Geo_NO]) * this is the original one that I thought wasnโ€™t showing all the countries.

CONCATENATE([Geo_NO].[Geo_Name], " โ€“ ", LIST([Country_Geo_NO]))

[Geo_NO].[Geo_Name] & " โ€“ " & CONCATENATE([Country_Geo_NO])

Is one of these more efficient than the others?

Now I need to figure out how to get the reference or dereference to Geo_Name from Country_Geo_Name.
This is how I create the EnumList for Country_Geo_NO:
IN( [_THIS], SELECT(GEO[GEO_NO], [_THISROW].[GEO_NO] = [REGION MATCH]))

This is the table structure for Geo:

CONCATENATE() is just a fancy form of using the & symbol, I believe. So they should all be basically equal.

For that youโ€™ll need to replace [Country_Geo_NO] with a Select statement to get the column data you want.

Top Labels in this Space