Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Add column when loading with if

Hi

I have a column: Otstanding_amount

I would like to add an another column named Status with a script. This column needs to be filled in automatically as follows:

"Outstanding amount to be payed" when the value of Outstanding_amount is not zero

"Payed" when the outstandin amount is zero

Here is my script:

LOAD [Invoice number],

          [Total amount],

          Outstanding_amount

          ?????? as Status

FROM

$(My_Path)\Tabel 2.2 Clients.xlsx

(ooxml, embedded labels, table is [xls-1212-140305]);

1 Solution

Accepted Solutions

Re: Add column when loading with if

Try this

LOAD [Invoice number],

          [Total amount],

          Outstanding_amount

          if(Outstanding_amount <> 0, 'Outstanding amount to be payed', 'Payed') as Status

From

$(My_Path)\Tabel 2.2 Clients.xlsx

(ooxml, embedded labels, table is [xls-1212-140305]);

2 Replies

Re: Add column when loading with if

Try this

LOAD [Invoice number],

          [Total amount],

          Outstanding_amount

          if(Outstanding_amount <> 0, 'Outstanding amount to be payed', 'Payed') as Status

From

$(My_Path)\Tabel 2.2 Clients.xlsx

(ooxml, embedded labels, table is [xls-1212-140305]);

Re: Add column when loading with if

HI

You can also try with match()

LOAD [Invoice number],

          [Total amount],

          Outstanding_amount

        if(Match(Outstanding_amount,0),'Payed','Outstanding amount to be payed') as Status

From

$(My_Path)\Tabel 2.2 Clients.xlsx

(ooxml, embedded labels, table is [xls-1212-140305]);