Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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} |
Country | 4 |
Population | 3 |
Square Footage | 3 |
I tried using an expression like this:
COUNT([$($Field)])
But it didn't work...
Notice I don't want this:
$Field | COUNT($Field) // COUNT of Tables in which that $Field appears |
Country | 2 |
Population | 1 |
Square Footage | 1 |
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?
Example of an expression which allows swuehl's solution to be more future-proof