Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

agrimroquette
Valued Contributor

Mapping fields?

Hi,

I have some in appropriate data, and I want to correct three fields.

Here is the sample data, and correction (in blue)

Capture.PNG

13 Replies
arvind_patil
Valued Contributor III

Re: Mapping fields?

HI Agrim,

I hope you Have Party Name wise Correct data in following way:

Party Name            Correct City        Correct State





So Use apply Map Two Times As Below:


CityMapping:

Mapping Load

[Party ID],

[Correct City ]

From <Path>


StateMapping:

Mapping Load

[Party ID],

[Correct State ]

From <Path>




Use apply Map into your base table two times one for city and one for state



ApplyMap('CityMapping','[Party ID]',City) as  CorrectCity,

ApplyMap('StateMapping','[Party ID]',State) as  CorrectState


Thanks,

Arvind Patil




agrimroquette
Valued Contributor

Re: Mapping fields?

Hi,

Thanks for reply, i have data like this:-

  

factoryparty_namecitystateregioncountrycontinent
GaSALEMGUJARATWESTINDIAASIA
GbCOMMONKARNATAKASOUTHINDIAASIA
GcBANGALOREDELHISOUTHINDIAASIA
GdAHMEDABADGUJARATSOUTHINDIAASIA
GeDELHICOMMONSOUTHINDIAEUROPE
GfBANGALOREKARNATAKASOUTHINDIAASIA
GgBANGALOREKARNATAKASOUTHINDIAASIA

but i dont have correct data with me that i shown in blue

techvarun
Valued Contributor II

Re: Mapping fields?

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

agrimroquette
Valued Contributor

Re: Mapping fields?

Hi Varun,

i want to map party name wise state and city because i have many city and state is 'COMMON'

i want is if i select party_name "b" i want city as bangalore and State as Karnataka, i hope u understand my issue,

arvind_patil
Valued Contributor III

Re: Mapping fields?

But you Know what correct fields against what party name.

Thanks,

Arvind Patil

techvarun
Valued Contributor II

Re: Mapping fields?

Is it possible to share the data here?

Thanks,

Varun

antoniotiman
Honored Contributor III

Re: Mapping fields?

Hi Agrim,

You can use DynamicUpdateCommand in Macro like this

Sub Update
SET Result = ActiveDocument.DynamicUpdateCommand ("UPDATE Table SET city = 'BANGALORE' WHERE factory='G' and party_name='b' ")
End Sub

This Macro works in Ajax Mode as well.

You can link this Trigger on OnOpen Doc or Botton Action.

See Attachment

Regards,

Antonio

arvind_patil
Valued Contributor III

Re: Mapping fields?

HI Agrm,

You must create Master according to your party name wise which you want to select manually.

Party Name     City      State

and apply as i mentioned above.

Thanks,

Arvind Patil

agrimroquette
Valued Contributor

Re: Mapping fields?

can you please give me a small example?

Community Browser