Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I got one question about getting the distinct value inside the cell
As you can see from the image, I would like to get only :
DT-PT
PT
I want to avoid the repeat value. The solution must be in the script editor please.
Thank you in advance
Not sure about combinations you may have in your data.. but something like that could work:
,If(CODE_DEMI_TRAITEMENT like '*DT*' and CODE_DEMI_TRAITEMENT like '*PT*','DT-PT',
If(CODE_DEMI_TRAITEMENT like '*DT*' and not CODE_DEMI_TRAITEMENT like '*PT*','DT',
If(CODE_DEMI_TRAITEMENT like '*PT*' and not CODE_DEMI_TRAITEMENT like '*DT*','PT','OTHER'
))) as [your distinct field]
cheers
Try something like this
CleanedTable:
LOAD
Checkb1,
Concat(DISTINCT SubField(CODE_DEMI_TRAITEMENT, '-', IterNo()), '-') as CODE_DEMI_TRAITEMENT_CLEAN
Resident RawTable
While IterNo() <= SubStringCount(CODE_DEMI_TRAITEMENT, '-')+1
Group By Checkb1;