Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use $Field to get the COUNT() of members in each Field

I have this data:

LOAD * INLINE [

Country, Population

Portlandia, 1

Girlana, 2

Festonville, 3

];

LOAD * INLINE [

Country, Square Footage

Portlandia, 100

Girlana, 200

Festonville, 300

Bombast, 300

];

I want to see this table:

$Field{Count of Distinct Members in that $Field}
Country4
Population3
Square Footage3

I tried using an expression like this:

COUNT([$($Field)])

But it didn't work...

Notice I don't want this:

$FieldCOUNT($Field) // COUNT of Tables in which that $Field appears
Country2
Population1
Square Footage1
11 Replies
Not applicable
Author

Furthermore, I think we could produce this expression dynamically using CONCAT() (rather than handwriting it) so that the formula may be ugly (and slow), but at least the user needn't rewrite it anytime they added new $Fields?

Not applicable
Author

Example of an expression which allows swuehl's solution to be more future-proof