Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
For example, if my datamodel has 3 fields Account, ClientID and City, the %FieldList will simply have 3 rows as following :
concat(%FieldList,',') = Account,ClientID,City
Let's say I have 2 accounts, 10 clientID and 3 cities.
I am trying to build a straight table such as :
- Dimension 'Field' : %FieldList
- Expression 'Count' : =count(DISTINCT %FieldList)
The result would be :
Field | Count |
---|---|
Account | 2 |
ClientID | 10 |
City | 3 |
For now, the turnaround could be using a pick function with the list of each possibility (which could be dynamically written into a variable) as per below :
=pick(match(%_DimList,'Account','ClientID','City'),
count(DISTINCT Account),
count(DISTINCT ClientID),
count(DISTINCT City))
But I wonder if there is a smarter & more efficient way to do that.
Thanks for your help !
Emilien
data:
LOAD Field,
Count
FROM
[D:path);
load
Count,
if(match( Field, 'Account'),Count) as Account,
if(Match(Field,'ClientID'),Count) as ClientID,
if(Match(Field,'City'),Count) as City
Resident data;
Output: