Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

antoniotiman
Honored Contributor III

Re: Mapping fields?

You can't.

techvarun
Valued Contributor II

Re: Mapping fields?

Hi,

Please find the below output.

sample.PNG

Master:

LOAD * INLINE [

    factory, party_name, city, state, region, country, continent

    G, a, SALEM, GUJARAT, WEST, INDIA, ASIA

    G, b, COMMON, KARNATAKA, SOUTH, INDIA, ASIA

    G, c, BANGALORE, DELHI, SOUTH, INDIA, ASIA

    G, d, AHMEDABAD, GUJARAT, SOUTH, INDIA, ASIA

    G, e, DELHI, COMMON, SOUTH, INDIA, EUROPE

    G, f, BANGALORE, KARNATAKA, SOUTH, INDIA, ASIA

    G, g, BANGALORE, KARNATAKA, SOUTH, INDIA, ASIA

];

Master1:

NoConcatenate LOAD factory,party_name,region,country,

If(state ='KARNATAKA', 'BANGALORE',If(state ='DELHI', 'DELHI', city)) as city,

If(city ='DELHI', 'DELHI', state) as state,

If(city ='DELHI', 'ASIA', continent) as continent Resident Master;

DROP TABLE Master

This may be a fix as of now. but the permanent fix is to create a master table and Implement Left join or Applymap in it.

still i can see Salem is tagged to Gujarat instead of Ahmadabad. and we cannot assume that either the state or city has a wrong mapping unless and untill we have a Master table(or File)

Thanks,

Varun.