Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Master II
Master II

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))))))

View solution in original post

2 Replies
chematos
Specialist II
Specialist II

whiteline
Master II
Master II

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))))))