Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nikain
Contributor
Contributor

How can I find a field value with other row's field value ?

Hi,

I'm stuck in this.

I have a table that token some field like name,school,number,isornotsequece,

data like this:

load * inline[

name,school,number,isornotsequece

'nick','school one','63231','63232,63233,63234,63235,63239'

'jane','school one','63232',''

'john','school two','63233',''

'nick','school three','63234',''

'nick','school four','63235',''

'nick','school five','63239',''

'nick','school six','63210','']

the boss need me to add another field named SamePersonOrNot

In my try is :

I  split the row 1 isornotsequece with ','  and got the 1st value is  63232 

then I want to use 63232 to find in this table's field number and find it row get the name is jane 

but I have not a method to support me to do like this.I use fieldIndex('name','63232') in the actual table from a qvd file. but I got the wrong name ....

the lookup function is not allowed to use in the chart.

please help out to stop my boss kill me .thank you all.

1 Solution

Accepted Solutions
Dalton_Ruer
Support
Support

Easy breezy just use the Qlik Previous function to compare if any value is the same on the previous row, as it is on this row. You want to have the data sorted in order to use this kind of approach

 https://help.qlik.com/en-US/sense/February2021/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecor...

IF(Name = Previous(Name), 'Yes', 'No') as SamePersonOrNotFlag

I'm not exactly sure what you are trying to do just throwing that out there. 

If you are just looking to figure out how to add a new field to your INLINE data you can do a preceding LOAD with inline statements just like other forms of data loading. That really comes in handy when you want to convert date values etc, or create flags with DUAL function:

Data:

Load name, school, number, isornotsequence, IF(name = Previous(name), 'Yes', 'No') as SamePersonOrNotFlag;

Load * inline[

name,school,number,isornotsequece

'nick','school one','63231','63232,63233,63234,63235,63239'

'jane','school one','63232',''

'john','school two','63233',''

 

View solution in original post

1 Reply
Dalton_Ruer
Support
Support

Easy breezy just use the Qlik Previous function to compare if any value is the same on the previous row, as it is on this row. You want to have the data sorted in order to use this kind of approach

 https://help.qlik.com/en-US/sense/February2021/Subsystems/Hub/Content/Sense_Hub/Scripting/InterRecor...

IF(Name = Previous(Name), 'Yes', 'No') as SamePersonOrNotFlag

I'm not exactly sure what you are trying to do just throwing that out there. 

If you are just looking to figure out how to add a new field to your INLINE data you can do a preceding LOAD with inline statements just like other forms of data loading. That really comes in handy when you want to convert date values etc, or create flags with DUAL function:

Data:

Load name, school, number, isornotsequence, IF(name = Previous(name), 'Yes', 'No') as SamePersonOrNotFlag;

Load * inline[

name,school,number,isornotsequece

'nick','school one','63231','63232,63233,63234,63235,63239'

'jane','school one','63232',''

'john','school two','63233',''