Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I'm trying to get the previous value of a Channel field where channel start with Survey.
Base Data:
Sequence Number | Channel |
1 | Website |
2 | Survey-1 |
3 | |
4 | Event |
5 | Survey-2 |
Required Output Data:
Sequence Number | Channel | Output Data |
1 | Website | - |
2 | Survey-1 | Website |
3 | - | |
4 | Event | - |
5 | Survey-2 | Event |
Thanks in advance!
/Daya
Hello,
this should meet your need
TEST:
Load
*
Inline [
Sequence Number, Channel
1, Website
2, Survey-1
3, Email
4, Event
5, Survey-2
];
NoConcatenate
TEST2:
Load
*
,
if(WildMatch(Channel,'*Survey*')<>0,previous(Channel),null()) as [Output Data]
Resident TEST
order by [Sequence Number];
drop table TEST;
Hi @Daya_Acc,
You can use below expression to get your desired outpu
If(Left(Channel, 6) = 'Survey', Peek('Channel', -1) , Null()) as PreviousSurveyChannel
Try this:
load SequenceNumber,
Channel,
if(WildMatch(Channel,'*Survey*'),Previous(Channel),null()) as OutputData
resident table;