Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Is there a function that works opposite to the previous() function ?

Instead of looking at who the new customers are, I would like to identify which customers have been churned out in the next period. So looking for a function that works opposite to the previous() function.

9 Replies
Not applicable
Author

Hi,

The same previous condition itself can do your requirement

Just check if(previous(Customer)=Customer,'1','0') AS Flag

Here who having 1 the existing customer or they are the new one

Not applicable
Author

Thanks Amutha.

I realized the same.

Anonymous
Not applicable
Author

another variant:

IF(NOT Previous(Customer)=Customer,0,1)

Clever_Anjos
Employee
Employee

There´s no function to "look ahead" into dataflow to check what would be your next value to a field.

You should rewrite your logic as recommended by Amuthabharathi Subramanian

Gabriel
Partner - Specialist III
Partner - Specialist III

HI,

try Peek() function.

Best regards.

Not applicable
Author

I'm looking to do something very similar. I have a field called 'FlowDirection'. If the record ahead has a value of 'Backwatrds' I want the field I'm creating to have 'Y' else 'N'. I don't quite see how I can fit this into the logic provided thus far.

Any help would be greatly appreciated.

Anonymous
Not applicable
Author

is it dependent of the current field that is being analysed?

You can do it in 2 steps, first flag the FlowDirection with backwatrds as Yes in Flag 1.

then, reverse the sort order

and then use the Previous function to flag your final flag for this who have yes in Flag 1

Not applicable
Author

Thanks eruditio, that work work spot on.

Anonymous
Not applicable
Author

glad to be of help