Forum Discussion

msmays5's avatar
msmays5
Helper II
6 years ago
Solved

Count Rows Based on Disconnected Tables

I have a 'Mapping' table with the following columns: Mapping[Country] and Mapping[Region].   I have a second table 'Articles' that has two columns: Article[ID] and Article[Geography_Tags]. The Arti...
  • msmays5's avatar
    msmays5
    6 years ago

    I was able to solve this. For anyone who comes across this:

     

    Count of Articles =
    MAXX (
        Mapping,
        VAR _countrySemiColon =
            CONCATENATE ( ";", Mapping[Country ] )
        VAR _regionSemiColon =
            CONCATENATE ( ";", Mapping[Region Tag] )
        VAR _FilteredTable =
            FILTER (
                Articles,
                (
                    SEARCH ( _countrySemiColon, Article[Geography_Tags],, 0 ) <> 0
                        || SEARCH ( _regionSemiColon, Article[Geography_Tags],, 0 ) <> 0
                )
            )
        RETURN
            COUNTROWS ( _FilteredTable )
    )