Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

tsoley341854
New Contributor III

Addin New fields together in scripts

I have created 2 new fields in my scripts and would like to add them together, can this be done in the same scripts??

if(NEW_THIS_MONTH_IND = 'Y'  AND  ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y', '1', '0') AS [NEW AND ASSIGNED],

If(ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y'  AND  NEW_THIS_MONTH_IND <> 'Y', '1', '0') AS [ASSIGNED NOT NEW COUNT],

I tried this but didn't work

Count(if([NEW AND ASSIGNED]+[ASSIGNED NOT NEW COUNT]))as [New and First Time Assignments],

1 Solution

Accepted Solutions

Re: Addin New fields together in scripts

May be like this:

RangeSum(

    If(NEW_THIS_MONTH_IND = 'Y'  AND  ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y', '1', '0'),

    If(ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y'  AND  NEW_THIS_MONTH_IND <> 'Y', '1', '0')

) as [New and First Time Assignments]

View solution in original post

3 Replies

Re: Addin New fields together in scripts

May be like this:

RangeSum(

    If(NEW_THIS_MONTH_IND = 'Y'  AND  ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y', '1', '0'),

    If(ASSIGNED_FIRST_TIME_THIS_MONTH_IND = 'Y'  AND  NEW_THIS_MONTH_IND <> 'Y', '1', '0')

) as [New and First Time Assignments]

View solution in original post

tsoley341854
New Contributor III

Re: Addin New fields together in scripts

Sunny,

Thanks for your reply it worked.

Tom

Re: Addin New fields together in scripts

Awesome, I am glad it did. Please close the thread by marking the correct answer.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny