Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to get the column names into my formula

wonka1234
10 - Fireball

Hi,

 

This is my output:

 
TeamCityDepositsRight_TeamRight_CityRight_DepositsResult
RaptorsMontreal5000000RaptorsMontreal5000000Matched
CanadiansMontreal100000   Data 1 Unmatched in Data 2
LeafsToronto200000   Data 1 Unmatched in Data 2
RaptorsToronto100000   Data 1 Unmatched in Data 2
   RaptorsToronto10Data 2 Unmatched in Data 1
   LeafsToronto2300000Data 2 Unmatched in Data 1
   CanadiansMontreal1500000Data 2 Unmatched in Data 1
 
 
 
 

 

As you can see it compares like columns.

However in my rsult formula, is it possible to switch it from "Data 1 Unmatched in Data 2" to something like

 

Row 2 result would be - Data 1 unmatched in Data 2: Team, City, Deposits.  

 

COuld this be done?

 

 

 
 

 

 

 

 
 
 

 

 

6 REPLIES 6
apathetichell
19 - Altair

convert to string. add a record id. transpose - use recordid as a key field. use a formula tool to extract if [Name] contains "Right" or not - call it "source" (or something). group by recordid/source/concatenate [Value] with no delimiter. join on recordid. compare if the two concatenated values are equal. if they are  "Matched" if one source is empty - then you can build your logic etc... join this new field back to your original data on recordid.

apathetichell
19 - Altair

If you want to add where specifically the [Name] field doesn't match you'd do the same kind of transpose. You'd remove the "Right_" suffix from the data2 fieldnames. Then you'd summarize group by record id/name and count distinct values in value. filter where the distinct value is not 1 and then concatenate the name field by record id - this would tell you which fields in each records don't match.

wonka1234
10 - Fireball

@apathetichell  anychance you can recreate the workflow?

nagakavyasri
12 - Quasar

Use 'Multi-Field Formula' tool to get Column names

 

Screenshot 2023-06-23 133613.png

wonka1234
10 - Fireball

@nagakavyasri thanks, the only issue is the the columns loook to be hardcoded here -

 

 
 

IF Contains([Result], "unmatched") THEN [Result]+":"+[Team]+","+[City]+","+[Deposits] ELSE [Result] ENDIF

 

 

nagakavyasri
12 - Quasar

Updated workflow, let me know if this helps:

 

Screenshot 2023-06-23 163647.png

Labels