Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cut FQDN to host and domain

Hi there again,

today I have a new Problem:

I have a list of FQDNs and paths, like:

//df020.sample.com/dfs/test$

test123.sample.com

new123.sample.com

//tf030.sample.com/new123

etc.

I need the hostnames standalone in a new field like test123, new123 but not the pathes.

Pathes can left blank in this new field.

I tried left, rigt, subfield, etc. but nothing really works.

Anybody an idea?

Thx in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Load

          PurgeChar(SubField(YourField, '.',1), '/') as HostName,

          SubField(YourField, '.',2) as Domain

View solution in original post

10 Replies
tresesco
MVP
MVP

Try like:

Load

          PurgeChar(SubField(YourField, '.',1), '/') as HostName,

          SubField(YourField, '.',2) as Domain

Not applicable
Author

Hi Tresesco,

thanx for your fast answer.

I tried your formula, but there I only get hostnames starting with numbers,

every other hostname starting with letter is empty?!

tresesco
MVP
MVP

Could you give one such example (the entire field value) that failed?

Not applicable
Author

Some failed ones:

aaaraehu000300p.sample.com

aawrtgj000500st.sample.com

nt546674dr.sample.com

mg45ffrt.sample.com

Good ones:

0dg556de.sample.com

586775436.sample.com

Every value starting with numbers is ok....

tresesco
MVP
MVP

I guess it would be something else that is causing the problem. Otherwise, for these values too the expression should work like:

Capture.PNG

Not applicable
Author

Hm, the problem must be anywhere else, you are right.

Is there a way to check in Qlik, if the values are all strings?

Or is there a chance to say: FQDN --> text?

tresesco
MVP
MVP

IsText() - to check if text or not

Text() - to convert into text

Not applicable
Author

They are all text....I don't understand this problem.

If I take the same data and cut it in Excel, everything is fine,

in Qlik only FQDNs with numbers at the start will work?

tresesco
MVP
MVP

Could you share the sample qvw with sample data to look into the issue?