Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

skh
Contributor

Syntax Help....

Hi All,

Need some help with some syntax please:

if

(MixMatch([Contractor / Permanent], 'Contractor', 'contractor','Contractor '), 'Contractors' or

if(MixMatch([Contractor / Permanent],'SI', 'SI ','SI Partner'),'SIPartner'), or
if(MixMatch([Contractor / Permanent],'?', 'FTC'), 'Other', [Contractor / Permanent])) as [Contractor / Permanent_New],

I would like to group my data together in certain buckets:

'Contractor', 'contractor','Contractor ' =  'Contractors'

'SI', 'SI ','SI Partner' = 'SIPartner'

'?', 'FTC' =  'Other'

Then call the the rest keep it the same and for the new buckets created create a new field called [Contractor / Permanent_New].

Thanks,

Sunil

Tags (1)
1 Reply
MVP
MVP

Re: Syntax Help....

Hi Sunil,

I'd use instead a mapping load and a MapSubString() in the field

OldNewValueMap:

MAPPING LOAD * INLINE [

Contractor, Contractors

contractor, Contractors

Contractor , Contractors

SI, SIPartner

SI , SIPartner

SI Partner, SIPartner

?, Other

FTC, Other

];

Change:

LOAD *,

     MapSubString('OldNewValueMap', [Contractor / Permanent]) AS [Contractor / Permanent_New]

INLINE [

Contractor / Permanent

Contractor

Different Value

contractor

SI Partner

?

FTC

ftc

];

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Community Browser