Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ashok1203
Creator II
Creator II

Can Listbox display the values by aggreation expression

Hi,

I need to create a list box with the values is 'Y' and 'N'.

If the sum(sales) values is 'Zero' then we need to display the values as 'N' else 'Y'.

This condition will be working to me in charts but not listbox.

Can anyone suggest how we will display the values in the listbox.

AAK
1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

When you are saying SUM(Sales) > 0 then which dimension you are considering?

I mean Customer, Country or Product..

use below calculated dimension to create list box with Values 'Y' or 'N'

=Aggr(IF(SUM({<Customer,Sales>}Sales)>0,'Y','N'),Customer)

Replace Customer with your dimension.

View solution in original post

12 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You need a primary field value to fill the list box. A sum() at the outer level will aggregate everything that has been activated, and will result in either 0 or non-zero. I don't think that is what you want, correct?

You can always create a listbox with, dsay, customerID, and an expression like you specified in your post. The sum will be recalculated and produce a Y or N value for every customerID that is active (white or green).

See the Expressions tab in the Listbox Properties

Anonymous
Not applicable

It will work in the list box as well

Select list box-Go to expression -

write  =if(sum(Sales)=0,'N','Y')

ashok1203
Creator II
Creator II
Author

Hi,

If i write the expression it is showing the values in the listbox expressions. But the problem is we need to define the field for the listbox. So, in that case it is showing the data as field along with the value. But i need a list box, that contains the values only 'Y' and 'N'.

AAK
MK_QSL
MVP
MVP

When you are saying SUM(Sales) > 0 then which dimension you are considering?

I mean Customer, Country or Product..

use below calculated dimension to create list box with Values 'Y' or 'N'

=Aggr(IF(SUM({<Customer,Sales>}Sales)>0,'Y','N'),Customer)

Replace Customer with your dimension.

ashok1203
Creator II
Creator II
Author

Hi,

I looked at the granularity. the primary key field is 'Product Number'. Can you tell me, how we will write the expression in the list box that contains the values only 'Y' and 'N'.

AAK
Anonymous
Not applicable

if we apply above calculated condition we can get only Y or N, but he is expecting values are Y, N in the list box

@ashok1203 --try this in the script level might it will work

ashok1203
Creator II
Creator II
Author

Hi,

By using the Manish method, I am getting the output as required. But, the problem is when i selecting value on the list box, the other value is not appearing in the Gray colour. Can you please help me on this.

AAK
MK_QSL
MVP
MVP

What you are not getting? My solution should work. Provide sample app showing what you have done and what you are not getting..

manideep78
Partner - Specialist
Partner - Specialist

PFA !