Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get values correct in field

Hi,

I Have address field and if there is no value in county means I have to show blank value but instead my straight table is showing postcode instead of county can anyone help me how to do this.

Address,

      subfield(Address, ',' , 1) as Address1,

      subfield(Address, ',' , 2) as Address2,

         subfield(Address, ',' , 3) as Address3,

         subfield(Address, ',' , 4) as Town,

         subfield(Address, ',' , 5) as County,

         subfield(Address, ',' , 6) as Postcode

1 Solution

Accepted Solutions
rustyfishbones
Master II
Master II

Here is a file showing that it works when I add some text objects

HTH

View solution in original post

9 Replies
Not applicable
Author

Any help please

rustyfishbones
Master II
Master II

Hi,

If PostCode is the last part of the Address you could try

SUBFIELD(Address,',', -1) AS PostCode

Not applicable
Author

Thanks and if I want to get the same for other fields also i,e if the data presents in the field then it shouid take value, otherwise it should show blank is it possible?

rustyfishbones
Master II
Master II

It depends on how the Address is set up at source

if each part of the Address is seperated by a comma you should get a blank value when it's blank

Not applicable
Author

Yes  the Adress is separated by comma like for eg:

3 Nora Street , , UK, NE34 0RA

is it possible to get correct please help as I am not getting idea.

jagannalla
Partner - Specialist III
Partner - Specialist III

Hi,

Try this,

LOAD *,

If(Country='',Null(),subfield(Address, ',' , 1)) as Address1,

If(Country='',Null(),subfield(Address, ',' , 2)) as Address2,

If(Country='',Null(),subfield(Address, ',' , 3)) as Address3;

LOAD * INLINE [

    Country, Address

    India, "SD,47,MNCL"

    ,"SD1,471,MNCL1"

];

Hope it helps you....

Cheers!!

Jagan

rustyfishbones
Master II
Master II

Here is a file showing that it works when I add some text objects

HTH

jagannalla
Partner - Specialist III
Partner - Specialist III

Sorry for the misunderstanding...

Not applicable
Author

Thanks and it's working.