Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

trimming data

Hi everyone,

I have some data which I would like to 'trim' where anything after the 'full stop' is removed so bbc.co.uk would simple be bbc

I treid using the code below but that didn't seem to work.

left

(HostName, index(HostName, '.') -1) as HostNameShort

Any suggestions?

Thanks





Labels (1)
3 Replies
Not applicable
Author

try this:


left(HostName,index(HostName,'.')-1) as HostNameShort


Not applicable
Author

Is that not the same as I wrote? I think you may have missed the 'left' at the top of my code 🙂

Not applicable
Author

you're right, I didn't see that left at the top o_O

then try with trim, I'm guessing you may have some spaces around the ends.


left(trim(HostName),index(trim(HostName),'.')-1) as HostNameShort