Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

test

t

Labels (1)
2 Replies
maxgro
MVP
MVP

Directory;

tmp:

LOAD Key,

     flag

FROM

TestData.xlsx

(ooxml, embedded labels, table is Sheet1);

tmp1:

load

  *,

  if(flag='Y', alt(peek(countflag),0)+1, Peek(countflag)) as countflag

Resident

  tmp

order by Key;

DROP Table tmp;

table:

NoConcatenate

load

  Key,

  //countflag,

  if(isnull(flag), if(Odd(countflag),'Y','N'), flag) as flag

Resident

  tmp1;

DROP Table tmp1;

jerem1234
Specialist II
Specialist II

Here's another way:

Directory;

Table:

LOAD Key,

     flag

FROM

TestData.xlsx

(ooxml, embedded labels, table is Sheet1);

Temp:

Noconcatenate Load Key, if(flag='Y' and peek(flag)='Y', 'E', if(flag='Y', 'Y', if(peek(flag)='Y', 'Y', 'N'))) as flag

Resident Table;

Final:

NoConcatenate Load Key, if(flag='E', 'Y', flag) as flag

Resident Temp;

Drop Table Table, Temp;

Hope this helps!