Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mark a serial score in a column by one score using script

Dear all,

See here the 'problem'

First column contains observation number.

Second column Class contains scores 'Y'.

What I would like to get:

A field 'Output' where only one 'Y' is visible as representative for the groups of 'Y'.The empty space in the previous cell in field Class marks the position of 'Y' in the cell of field Output.

I suppose that shoudl be solved using peek function, but could you demonstrate an efficient solution?

Thanks,

Cornelis.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

LOAD

     Obs,

     Class,

     If(Class='Y' and Previous(Class) <> 'Y', Y) as Output

FROM

     ...source data...

     ;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

LOAD

     Obs,

     Class,

     If(Class='Y' and Previous(Class) <> 'Y', Y) as Output

FROM

     ...source data...

     ;


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

That is indeed the best solution and apparently very easy.

A little correction:

If(Class = 'Y' and Previous(Class) <> 'Y', 'Y') as Output

not Y but 'Y'.

Best regards,

Cornelis