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

Announcements
FLASH SALE: Save $500! Use code FLASH2026 at checkout until Feb 14th at 11:59PM ET. Register Now!
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





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