Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. 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
Highlighted
Partner
Partner

Quite simple:

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