Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I've got a set of data that looks like this:
Name | Room | Minutes |
---|---|---|
John | 1 | 1 |
Mary | 2 | 5 |
Jim | 1 | 11 |
Mary | 1 | 6 |
John | 1 | 5 |
Jim | 2 | 8 |
John | 2 | 2 |
Mary | 2 | 3 |
Mary | 1 | 7 |
Jim | 2 | 3 |
I need a field expression for the list box such that the list box only displays the Names that have spent more than 10 total Minutes in Room 1.
If(Aggr(Sum({<Room={1}>}Minutes),Nmae)>10,Name))
If(Aggr(Sum({<Room={1}>}Minutes),Nmae)>10,Name))
That did it.
Thank you!
Set expressions are something I have yet to master. The syntax trips me up regularly. Do you know of a tutorial on this that can show me a wide range of examples?
I am sure you might have tried what Sasidhar proposed and is an easiest way too. However, another way of getting your names is like try below: Just creating a new Field you can use in the listbox.
Room:
LOAD Name,
Room,
Minutes
FROM
[https://community.qlik.com/thread/296629]
(html, codepage is 1252, embedded labels, table is @1);
LEFT JOIN(ROOM)
Final:
LOAD Name, IF(Sum(Minutes) > 10, Name) AS FilteredName
Resident Room
Where Room = 1
Group By Name;
Thank you.
I will keep this in mind. It will likely help with other data sets I have where I can use the same condition in multiple objects.