Hello, I've got a question regarding the use of "arrays" in set analysis. I have the following data:
event | times |
click | 10 |
paint | 3 |
mouse move | 1 |
hover | 4 |
click | 5 |
scroll | 10 |
double click | 4 |
mouse over | 5 |
mouse leave | 5 |
I am using set analysis to sum mouse events that are not equal to a hard-coded list:
sum({<event-={"click","double click","scroll"}>} times)
The above expression works okay, but, Is there a way to use a list built with load inline instead of a static list?
filtered_events:
LOAD * INLINE [
click,
double click,
scroll
];
Hi,
Maybe try changing your inline to;
filtered_events:
LOAD * INLINE [
event, filter
click, yes
double click, yes
scroll, yes
];
Then your function maybe try;
sum({<event-={$(=''''&Concat(distinct {<filter={'yes'}>}event,''',''')&'''')}>} times)
I did initially try sum({<filter-={"yes"}>}times) ... but your things to not filter would need to exist in your filter table.
Cheers,
Chris.
Hi,
Maybe try changing your inline to;
filtered_events:
LOAD * INLINE [
event, filter
click, yes
double click, yes
scroll, yes
];
Then your function maybe try;
sum({<event-={$(=''''&Concat(distinct {<filter={'yes'}>}event,''',''')&'''')}>} times)
I did initially try sum({<filter-={"yes"}>}times) ... but your things to not filter would need to exist in your filter table.
Cheers,
Chris.
Hello @chrismarlow ,
I made a few adjustments to your expression, and is working just fine:
sum({<event-={$(=''''&Concat(event,''',''')&'''')}>} times)
note: filtered_events remain unchanged.
Correct me if I'm wrong, you are using '''' before and after concatenation to convert the sub-result to string.
Thanks for your help 🙂