Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jomamma1
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
bgerchikov
Partner - Creator III
Partner - Creator III

Quite simple:

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