How to compare letters of a single word in Appian:
Suppose,
We have to compare letters of word "Apple". The output should be:
1. Number of unique characters in word. In case of "Apple", it should be 4
2. Could of similar characters. Ex: In case of "Apple", A=1,p=2,l=1,e=1
Please provide code for this.
Discussion posts and replies are publicly visible
Hi Ayushimitaal,
Use Below Code
a!localVariables( local!word: "apple", local!letters: apply( charat(local!word, _), enumerate(len(local!word)) + 1 ), local!unique: union(local!letters, local!letters), a!flatten( a!forEach( local!unique, { fv!item & ": " & count(wherecontains(fv!item, local!letters)) } ) ) )
Thank you for your suggestion.