Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Re: Identify matching values in script based on certain criteria

Felipe,

Just for fun . Below link can help you if you really want to change your name.

How to Change First Name & Last Name in the Account

Have a good day too

Cheers

Highlighted

Re: Identify matching values in script based on certain criteria

Hi Kiran,

Since the flag has to be set for both the values I have sorted the data twice. We don't have any function like below() in script level in order to create flag.

In the first load, I have created a TempIdentity flag by sorting the DMBTR.absolute and SHKZG fields in ascending order.

If( (SHKZG = 'S' and Peek('SHKZG') ='H') And (DMBTR.absolute = Peek('DMBTR.absolute')), 'x') as Tempidentity
Resident Data
Order by DMBTR.absolute, SHKZG;

In the next step, I have created the identity flag by sorting the data SHKZG field in descending order. but I want to keep the previously created x in the final result. So finally to get the desired output I have created the identity field which uses the previously created field (Tempidentity)

Result:
Load *,
If( (SHKZG = 'H' and Peek('SHKZG') ='S') And (DMBTR.absolute = Peek('DMBTR.absolute')), 'x', Tempidentity) as identity
Resident IdentityTemp
Order by DMBTR.absolute, SHKZG desc;

  DROP Field Tempidentity;

DROP Table Data, IdentityTemp


As we are taking the resident load, all the fields will be available in the resulting table. Since we don't need Tempidentity field anymore, we are dropping it.


Hope this helps you.



Community Browser