Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Mark first instance of Value during Load

Hi

I am loading in a data file that contains a receipt number.  This number is duplicated against multiple lines.  To try to speed up calculations i am looking to populate a new column during the load with a 1 on the first instance of a new receipt number and a 0 on all duplicate lines.

I know I can do this via count(distinct in expressions but want to leverage to speed of sum by utilising 1 and 0 's.

Many thanks

Mark

1 Solution

Accepted Solutions
swuehl
Not applicable

Re: Mark first instance of Value during Load

Maybe like

LOAD

ReceiptNr,

if( exists(ReceiptNr),0,1) as FirstOccurrence,

...

FROM ...;

2 Replies
swuehl
Not applicable

Re: Mark first instance of Value during Load

Maybe like

LOAD

ReceiptNr,

if( exists(ReceiptNr),0,1) as FirstOccurrence,

...

FROM ...;

Not applicable

Re: Mark first instance of Value during Load

Hi Mark,

Your load script should look something like:

TempTable:

LOAD If(exists([Recept ID]),0,1),

     ID,

     [Recept ID],

     Amount

FROM

[Sample.xlsx]

(ooxml, embedded labels, table is Sheet1);

This will hopefully produce a table as you desire

Cheers,

Ravi