I've used the text analysis tool and saved off a topic vector to my dataset. This shows up as 10 new columns labeled Topic1 through Topic10. I want a new column called "dominant topic" which is labeled topic 1-10 based based on which of the previous 10 columns had the largest value. What's the easiest way to do this? I suppose I could write a large formula, but I'm hoping someone knows an easier way.
Here is a formula that will do what you want
If( Row() == 1,
varList = {"Topic1", "Topic2", "Topic3", "Topic4", "Topic5", "Topic6",
"Topic7", "Topic8", "Topic9", "Topic10"}
);
valueList = {};
For( i = 1, i <= N Items( varList ), i++,
Insert Into( valueList, As Column( varList[i] ) )
);
TheTopic = "Topic" || Char( Contains( valueList, Max( valueList ) ) );
TheTopic;