Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Create Custom Field During LOAD

I'm new to Qlik - so please bear with me as my question is a basic one, but I can't seem to find the right way.
During LOAD, I have it reading in a CSV file which is perfect. I want to create a new field on the fly based on the data as it loads in. Below is what I have:

LOAD Account,

     Product,

     Division,

     Amount

FROM

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

So my goal is to create a new field called "Special" which populates with "Yes" if Amount is >=0.01, otherwise "No".

How do I do this?

Tags (3)
1 Solution

Accepted Solutions
jer_2011
Contributor II

Re: Create Custom Field During LOAD

Hello,

you can try with this option

LOAD Account,

            Product,

            Division,

            Amount,

          If( Amount >= 0.01, 'Yes' , 'No' ) as Special

FROM (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

hope it works

2 Replies
jer_2011
Contributor II

Re: Create Custom Field During LOAD

Hello,

you can try with this option

LOAD Account,

            Product,

            Division,

            Amount,

          If( Amount >= 0.01, 'Yes' , 'No' ) as Special

FROM (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

hope it works

Not applicable

Re: Create Custom Field During LOAD

Thanks! Worked like a charm!

Community Browser