I have the data like below. And I want to get an output like Potato Board..

838    Asked by NitinSingh in Tableau , Asked on Dec 15, 2019
Answered by Asutosh Jha

Potato 1TByte 4.5 NFA

Board 256GByte 553 NCA

Looking at the output you’re looking for, it seems you just want to have the first word from each row. First find the delimiter you think can solve this and put that in a calculated field. The code will look like below-

IF (SPLIT(LEFT([Data], LEN([Data])-(FIND([Data],"Byte")+1))," ",1))=(SPLIT(LEFT([Data], LEN([Data])-(FIND([Data],"Byte")+1))," ",-2)) THEN (""+(SPLIT(LEFT([Data], LEN([Data])-(FIND([Data],"Byte")+1))," ",1)))

ELSE

((SPLIT(LEFT([Data], LEN([Data])-(FIND([Data],"Byte")+1))," ",1))+" "+ (SPLIT(LEFT([Data], LEN([Data])-(FIND([Data],"Byte")+1))," ",-2))) END

And then just use both the main field and calculated field and you’ll get the output.




Your Answer

Interviews

Parent Categories