Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Assigning a value to a key field

Can anyone tell me why I don't get values from my team field when the following statement is true. I only get zeros when it isn't met. So if the BreakoutProviderSideActivity.Team is equal to CVN then I want BreakoutTeam to equal NSO. Any ideas?

LOAD BreakoutProviderSideActivity.ID,

    BreakoutProviderSideActivity.Week,

    BreakoutProviderSideActivity.Employee,

    BreakoutProviderSideActivity.Team,

    if(BreakoutProviderSideActivity.Team='CVN','NSO',0)  or

     if(BreakoutProviderSideActivity.Team='OS','NSO',0) or

     if([BreakoutProviderSideActivity.Team]='PDS','PED',0) or

      if([BreakoutProviderSideActivity.Team]='MFM','OBG',0) or

      if([BreakoutProviderSideActivity.Team]='GST','GRI',0) or

    if([BreakoutProviderSideActivity.Team]='ORE','GRI',0) as BreakoutTeam,

    [BreakoutProviderSideActivity.Days Booked]

   

FROM   

    [\\slcnasp01\Qlikview_Data\qliktech_user\DavidHill_Dev\2_Loaders-QVW\QVDs\BreakoutProviderSideActivity.qvd]

(qvd);

1 Solution

Accepted Solutions
whiteline
Honored Contributor II

Re: Assigning a value to a key field

You didn't write the expression for that.

Consider BreakoutProviderSideActivity.Team='CVN'

Evaluate your expression for BreakoutTeam:

if('CVN'='CVN','NSO',0)  or

if('CVN'='OS','NSO',0) or

if('CVN'='PDS','PED',0) or

if('CVN'='MFM','OBG',0) or

if('CVN'='GST','GRI',0) or

if('CVN'='ORE','GRI',0)

next step:

'NSO' or 0 or 0 or 0 or 0 or 0

the result is NULL.

upd:

I suppose you want this:

if(BreakoutProviderSideActivity.Team='CVN','NSO',

if(BreakoutProviderSideActivity.Team='OS','NSO',

if(BreakoutProviderSideActivity.Team='PDS','PED',

if(BreakoutProviderSideActivity.Team='MFM','OBG',

if(BreakoutProviderSideActivity.Team='GST','GRI',

if(BreakoutProviderSideActivity.Team='ORE','GRI',0))))))

2 Replies
Highlighted
chematos
Valued Contributor II

Re: Assigning a value to a key field

whiteline
Honored Contributor II

Re: Assigning a value to a key field

You didn't write the expression for that.

Consider BreakoutProviderSideActivity.Team='CVN'

Evaluate your expression for BreakoutTeam:

if('CVN'='CVN','NSO',0)  or

if('CVN'='OS','NSO',0) or

if('CVN'='PDS','PED',0) or

if('CVN'='MFM','OBG',0) or

if('CVN'='GST','GRI',0) or

if('CVN'='ORE','GRI',0)

next step:

'NSO' or 0 or 0 or 0 or 0 or 0

the result is NULL.

upd:

I suppose you want this:

if(BreakoutProviderSideActivity.Team='CVN','NSO',

if(BreakoutProviderSideActivity.Team='OS','NSO',

if(BreakoutProviderSideActivity.Team='PDS','PED',

if(BreakoutProviderSideActivity.Team='MFM','OBG',

if(BreakoutProviderSideActivity.Team='GST','GRI',

if(BreakoutProviderSideActivity.Team='ORE','GRI',0))))))