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

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
CELAMBARASAN
Partner - Champion
Partner - Champion

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

View solution in original post

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

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

MayilVahanan

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

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.