Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

compare two fields - return 'match' or 'nomatch'

I have two fields that I loaded in

 

 

HostStatusPrevious

 

HostStatusCurrent

 

The fields are loaded in a table such as:

 

HWStatus as HWStatusCurrent,

 

Oct:
LOAD AssetID_Value as matchme,
HostName_Value as HostnamePrev
HWStatus_Value as HWStatusPrev

.

.

.

from excelfile1;

 

Jan:
Outer join (Oct)
LOAD AssetID as matchme,
HostName as HostnameCurrent
HWStatus as HWStatusCurrent,

.

.

.

from excelfile2;

 

How do i compare hwstatusprev and hwstatuscurrent and return a 'match' or 'nomatch' in a howstatusstate field.

 

thx.

 

 

 

 

 

Labels (1)
1 Reply
Partner
Partner

Quite simple:

Data:
Load *,
    If(HWStatusCurrent <> HWStatusPrev and HostnameCurrent = HostnamePrev, 'match','nomatch') as MatchFlag
Resident
    Oct
;
Drop table Oct;