Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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.

Tags (1)
9 Replies
Not applicable

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

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

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

Thanks Amutha.

I realized the same.

eruditio
Contributor III

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

another variant:

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

Employee
Employee

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

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
Valued Contributor II

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

HI,

try Peek() function.

Best regards.

Not applicable

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

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.

eruditio
Contributor III

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

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

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

Thanks eruditio, that work work spot on.

eruditio
Contributor III

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

glad to be of help

Community Browser