Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
userxxxxxx
Contributor II
Contributor II

Set Analysis and array-list

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
];

Labels (2)
1 Solution

Accepted Solutions
chrismarlow
Specialist II
Specialist II

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.

View solution in original post

2 Replies
chrismarlow
Specialist II
Specialist II

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.

userxxxxxx
Contributor II
Contributor II
Author

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 🙂