Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

create new field in the script - Cross table

Hi!

I have the following Table1 in my script:

Table1:

CrossTable(Month, Val, 1)

LOAD INDICATOR,

    [1] as Jan,

    [2] as Feb,

    [3] as Mar,

    [4] as Apr,

    [5] as May,

    [6] as Jun,

    [7] as Jul,

    [8] as Aug,

    [9] as Sep,

    [10] as Oct,

    [11] as Nov,

    [12] as Dec

FROM

xxxx

INDICATOR can have 4 possible values ('A','B','C','D'). All the other columns have numerical values.

I would like to add a new INDICATOR value called 'AB, which are the sum of the values where INDICATOR is 'A' or 'B'

Thank you!

Tags (2)
1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

Re: create new field in the script - Cross table

Table1:

CrossTable(Month, Val, 1)

LOAD

//INDICATOR,

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

    [1] as Jan,

    [2] as Feb,

    [3] as Mar,

    [4] as Apr,

    [5] as May,

    [6] as Jun,

    [7] as Jul,

    [8] as Aug,

    [9] as Sep,

    [10] as Oct,

    [11] as Nov,

    [12] as Dec

FROM

xxxx

View solution in original post

2 Replies
Highlighted
Specialist II
Specialist II

Re: create new field in the script - Cross table

Table1:

CrossTable(Month, Val, 1)

LOAD

//INDICATOR,

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

    [1] as Jan,

    [2] as Feb,

    [3] as Mar,

    [4] as Apr,

    [5] as May,

    [6] as Jun,

    [7] as Jul,

    [8] as Aug,

    [9] as Sep,

    [10] as Oct,

    [11] as Nov,

    [12] as Dec

FROM

xxxx

View solution in original post

Highlighted
Not applicable

Re: create new field in the script - Cross table

Hi,

Table1:

CrossTable(Month, Val, 1)

LOAD

If(INDICATOR='A' or INDICATOR='B','AB',INDICATOR) as INDICATOR,

    [1] as Jan,

    [2] as Feb,

    [3] as Mar,

    [4] as Apr,

    [5] as May,

    [6] as Jun,

    [7] as Jul,

    [8] as Aug,

    [9] as Sep,

    [10] as Oct,

    [11] as Nov,

    [12] as Dec

FROM

<Table_Name>;

i think it might help u.