Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have assign Key to raw data that i have as below, the value should be same till the value is Query.
So in Below Table when the Value is Query it should assign new Key For example 1 for Card Object and Event it would remain same than again when it encounters "Query" it becomes 2
| Value | User_Account | Search | Time |
| Event | ABC | - | 10/01/2019 15:42 |
| Object | ABC | - | 10/01/2019 15:42 |
| Card | ABC | - | 10/01/2019 15:42 |
| Query | ABC | Flynn | 10/01/2019 15:43 |
| Event | XYZ | - | 10/01/2019 11:43 |
| Object | XYZ | - | 10/01/2019 11:43 |
| Card | XYZ | - | 10/01/2019 11:43 |
| Query | XYZ | DAN | 10/01/2019 11:43 |
Can you please help how i can achieve this in Load script.
May be this
Table:
LOAD *,
RowNo() as RowNum,
If(Value = 'Query', RangeSum(Peek('Key'), 1), Alt(Peek('Key'), 1)) as Key;
LOAD * INLINE [
Value, User_Account, Search, Time
Event, ABC, -, 10/01/2019 15:42
Object, ABC, -, 10/01/2019 15:42
Card, ABC, -, 10/01/2019 15:42
Query, ABC, Flynn, 10/01/2019 15:43
Event, XYZ, -, 10/01/2019 11:43
Object, XYZ, -, 10/01/2019 11:43
Card, XYZ, -, 10/01/2019 11:43
Query, XYZ, DAN, 10/01/2019 11:43
];
Thanks for Reply yes like this, but when i am applying to me data it is incorrect for couple of rows.PFA
It has assigned same Key("3") to 2 different user search
| priya | - | Card | 2019-01-11 05:20 | 3 | ||
| priya | - | Card | 2019-01-11 11:59 | 10 | ||
| priya | - | Card | 2019-01-11 12:08 | 10 | ||
| priya | - | Card | 2019-01-11 13:05 | 10 | ||
| priya | - | Card | 2019-01-11 14:42 | 18 | ||
| priya | - | Card | 2019-01-11 14:43 | 20 | ||
| 58537 | * | Search | 2019-01-11 11:37 | 1 | ||
| 58537 | * | Search | 2019-01-11 11:43 | 2 | ||
| 58537 | daniel | Search | 2019-01-11 11:46 | 3 | ||
| 58537 | - | Card | 2019-01-11 11:46 | 3 |
This data looks different than the one we started with... that one we were looking for the word Query... what are we looking for in here?