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

how to count the number of changes

Hi,

I have a dataset like:

value

0

1

0

0

0

1

1

0

1

0

0

1

1

1

0

0

etc.

Now I would like to count the number of changes from 0 to 1. (in the example above, the result would be 4) Does anyone have a clue?

thanks in advance.

Per

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You can use IF and Previous to make flags in the load script and then sum the flags. Please find example QVW attached.

Regards,

sebablum

View solution in original post

3 Replies
Not applicable
Author

Hi,

You can use IF and Previous to make flags in the load script and then sum the flags. Please find example QVW attached.

Regards,

sebablum

Not applicable
Author

Thanks!

I was trying to make a script like SUM(if (Value>above (value),1,0)), but I stranded on errors in this script. You provided me with a very nice solution.

greetz

Per

Not applicable
Author

You're welcome

//Sebastian