Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a simple question to which I can't seem to find the solution.
Is it possible to count some records and depending on this count display them in a ListBox.
Example:
I have a collection of numbers.
If a number appears more than once I want to display it in my ListBox.
If it only appears once I don't want that to happen.
It would be even better if this was possible like: "IF (Count(Numbers)>1, Display(Numbers))"
I thank anyone who answers in advance.
Dries
You can use the expression approach, but you will need to use the aggr() function.
=if(aggr(count(Field1),Field1)>1,Field1)
Take this sample inline table as an example:
LOAD * INLINE [
Field1, Field2
1, aaa
1, aaa
2, bbb
3, bbb
4, ccc
4, ccc
5, cdd
6, cdd
6, cdd
7, eee
8, eee
8, eee
];
When I create a list box with the following expression, I get 1,4,6 and 8 in a list box.
=if(aggr(count(Field1),Field1)>1,Field1)
Hope that helps.
Make a listbox, select <expression> as field and put
=if(Count(Numbers)>1,Numbers,Null()) as the expression.
I already came up with that but it doesn't seem to work for me.
Make a straight chart with dimension Numbers. Make expression
if(count(Numbers)>1,count(Numbers))
You can use the expression approach, but you will need to use the aggr() function.
=if(aggr(count(Field1),Field1)>1,Field1)
Take this sample inline table as an example:
LOAD * INLINE [
Field1, Field2
1, aaa
1, aaa
2, bbb
3, bbb
4, ccc
4, ccc
5, cdd
6, cdd
6, cdd
7, eee
8, eee
8, eee
];
When I create a list box with the following expression, I get 1,4,6 and 8 in a list box.
=if(aggr(count(Field1),Field1)>1,Field1)
Hope that helps.
It works.
Thanks a lot.