Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
eugeniyaromanov
Contributor III
Contributor III

To choose field if not contain

Hello!

I have a table:

NameContactTypeContact
1Phone12345678
1Addresstown 1, street 1, 1
1E-mailbla@bla.com
2E-mailbla1@bla.com
3Phone23456781
3Addresstown 3, street 3, 3
4Phone34567812
4Phone45678123
4Addresstown 4, street 4, 4
4Addresstown 5, street 5, 5
4E-mailbla2@bla.com

I need to select it to other table:

Phones: all in one field, divided by (;)

Address: first address in order of load

E-mail: first e-mail in order of load

I don't want to make selection depending on Type, because it happens to be phone number with address, e-mail with phone and so on.

So I decided to select numbers, text and '@'.

For mail I used: MinString(if(wildmatch(Contact,'*@*'), Contact)) and it worked (I guess only e-mail can be with '@')

For phone I used concat(num(Contact), ';') and it works fine too (it selects only number values)

But I can't figure out function for address, if there is no address it always puts an e-mail instead.

I think I want it to show only text if text does not contain @.

I've tried: MinString( if(not wildmatch(Text(Contact),'*@*'), Contact)) and it does not work properly, it shows phone or mail sometimes...

I would appreciate any help!

Thanks in advance!

18 Replies
eugeniyaromanov
Contributor III
Contributor III
Author

Not sure I understood...

The mail goal is to have a profile for a person, where all personal information is.

I've got a table where everything is messed up, address, phone and mail.

And I need to separate it in a chart.

In one field i need to show phones, in other address, in third e-mail.

If it's not there I need it to be like '-'.

ahaahaaha
Partner - Master
Partner - Master

Yes, the representation of address 1С does it by itself.

sunny_talwar

Can you share the expected output from your sample above... and this is needed in the front end chart?

eugeniyaromanov
Contributor III
Contributor III
Author

From data at first table i need to get:

NameAddressPhoneE-mail
1town 1, street 1, 112345678bla@bla.com
2--bla1@bla.com
3town 3, street 3, 323456781-
4town 4, street 4, 434567812;45678123 bla2@bla.com

How to handle with phone and e-mail I figured ( not sure I did it properly, but anyway it works)

I don't know how to handle with address.

eugeniyaromanov
Contributor III
Contributor III
Author

It worked!

eugeniyaromanov
Contributor III
Contributor III
Author

Sunny, at the end I did it with comas, in my data address always contains a coma,

so i did it:

MinString( if(wildmatch(Text(Contact),'*,*'), Contact))

Thanks for help!

ahaahaaha
Partner - Master
Partner - Master

Hi Sunny,

The program developer 1C in the ContactType field value Adress is assigned for both the usual address and for the e-mail address. That is the task of their separation. It would be more logical to make Adress1 for a regular address and Adress2 for an e-mail, but ... now like this.

Regards,

Andrey

eugeniyaromanov
Contributor III
Contributor III
Author

Thanks for helping!

After all it was so simple

I appreciate it!

ahaahaaha
Partner - Master
Partner - Master

I'm glad I could help.