Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

if the value is exists - how to check on row wise data

I have data is coming from table

KeyCode
HS0001
HS000H2000
HS000H2000H2001
HS000H2000H2002
HS000H2000H2003
HS000H2000H2998
HS000H2000H2999
HS000H3000
MP0002
MP000MPAA0
MP000MPAA0MPAA1
MP000MPAA0MPAA2
MP000MPAA0MPAA3
LS00A1
LS00AA10001
LS00AA1000A1001
LS00AA1000A1002
CNE003
CNE00CNEA0
CNE00CNEA0CNEA1

I would like to see the data for reporting  - checking the first 5 character or 10 character if the value exists in the Code column - I have to update the missing rows for the code.

Expecting   Results
KeyCode
HS0001
HS000H20001
HS000H2000H20011
HS000H2000H20021
HS000H2000H20031
HS000H2000H29981
HS000H2000H29991
HS000H30001
MP0002
MP000MPAA02
MP000MPAA0MPAA12
MP000MPAA0MPAA22
MP000MPAA0MPAA32
LS00A1
LS00AA10001
LS00AA1000A10011
LS00AA1000A10021
CNE003
CNE00CNEA03
CNE00CNEA0CNEA13


Advance thanks for your help.

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check with autonumber().use something like

     Autonumber(Left(Key,5)) as Code

Celambarasan

Not applicable
Author

autonumber will not work.Code has differen value 151,143,266 etc.It will not work .Example - I have shown the code as 1,2,3

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Then check with this

     If(Left(Key,5)<>Previous(Left(Key,5)),Code,Previous(Code)) as Code

Celambarsan

Message was edited by: Celambarasan Adhimulam

Not applicable
Author

hi, if(Left(key,5) ='HS000' or Left(key,5) ='LS00A',1,if(Left(key,5) ='MP000',2, if(Left(key,5) ='CNE00',3))) as code

Not applicable
Author

I have to deal with 5000 records .It is not easy to check and apply the condition one by one.I am looking for dynamically check and pickup the value

jansen28
Contributor III
Contributor III

You can perform it in the load script

Hierarchy (Key,Parent_key,Code,,,,,Depth)

LOAD Key,

     Mid(Key,1,5) as Parent_key,

     Code

FROM

$(v_Home_Path)\Qlikview Community\if the value is exists - how to check on row wise data\Test Data.xlsx

(ooxml, embedded labels, table is Sheet1);

And in your tables, you can use Key and Code1 as the fields