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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

splitting email ID to get domain name

Hi All,

 

I have a requirement to split the email ID to get the domain Name like

from abc@gmail.com to get gmail.com in tmap.

in other words i want to get everything after "@". please help. 

Labels (3)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

You can remove any characters preceding @ with the following expression :
row1.email.replaceAll("^.*@", "")

View solution in original post

9 Replies
Martintin
Contributor III
Contributor III

Hi

 

You can use the following expression :

row1.email.split("@")[1]

 

If we consider that your input row for the email is called row1.email.

 

Warm regards,

Martin

TRF
Champion II
Champion II

You can remove any characters preceding @ with the following expression :
row1.email.replaceAll("^.*@", "")
Anonymous
Not applicable
Author

Hi @mhodent ,

 

Thank you for your reply, but still i am not able to achieve what i wanted to.

i am getting below error.

 

Exception in component tDBInput_4_in (STG_TO_WAREHOUSE_USER)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'ST_USER_TEST.Email_Domain' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2832)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2781)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.tDBInput_4_inProcess(STG_TO_WAREHOUSE_USER.java:2050)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.runJobInTOS(STG_TO_WAREHOUSE_USER.java:3943)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.main(STG_TO_WAREHOUSE_USER.java:3792)
[statistics] disconnected

 


screenshot.JPG
Martintin
Contributor III
Contributor III

Can you send a picture of your job ? It would be easier to understand with it.

 

Check if the column name is the good one (Unknown column 'ST_USER_TEST.Email_Domain' in 'field list')

 

 

 

Anonymous
Not applicable
Author

here you go...

i am trying to get the domain name from email ID 


screenshot_1.JPG
Martintin
Contributor III
Contributor III

Not sure but replace ST_USER_TEST with USERS_MAIN when you call your input row int the tmap

 

Picture of the tmap would help

Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

Hi @TRF ,

 

i am not able to get the desired results yet.

below is the error i'm getting.

 

Exception in component tDBInput_4_in (STG_TO_WAREHOUSE_USER)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'ST_USER_TEST.Email_Domain' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4232)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4164)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2832)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2781)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1569)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.tDBInput_4_inProcess(STG_TO_WAREHOUSE_USER.java:2050)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.runJobInTOS(STG_TO_WAREHOUSE_USER.java:3943)
at local_project.stg_to_warehouse_user_0_1.STG_TO_WAREHOUSE_USER.main(STG_TO_WAREHOUSE_USER.java:3792)
[statistics] disconnected

TRF
Champion II
Champion II

This error is due to your SQL query.

Column Email_Domain doesn't exist in ST_USER_TEST table.