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

ValueList in Pie Chart

Hello,

I am getting a 'No data to display' with what I have below. I have three categories and I need to do a count, not a sum. I first started with Pick, but looking at discussions, I saw something like this.

Dimension

=(ValueList('We Win','Matched','They Win'))



Expression

=IF(ValueList('We Win','Matched','They Win') = 'We Win',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))<0,

=IF(ValueList('We Win','Matched','They Win') = 'Matched',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))=0,

=IF(ValueList('We Win','Matched','They Win') = 'They Win',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))>0,

)))


Thank you,

Martha

21 Replies
sunny_talwar

Absolutely

mp802377
Creator II
Creator II
Author

This is an example of the data file coming in. Normally the data would come through a database, but I put it in a csv so you could see it.

Data:

 

SITE,OBJECT,FARE
Our Company,iPad Mini,249.99
Our Company,iPad 10.5,649.99
Our Company,Samsung Galaxy Tab,599.99
Our Company,Lenovo Laptop Flex Gen 5,699.99
Our Company,Logitech Headset,59.99
Competitor One,iPad Mini,248.99
Competitor One,iPad 10.5,639.99
Competitor One,Samsung Galaxy Tab,549.99
Competitor One,Lenovo Laptop Flex Gen 5,625.99
Competitor One,Logitech Headset,74.99
Competitor Two,iPad Mini,259.99
Competitor Two,iPad 10.5,649.99
Competitor Two,Samsung Galaxy Tab,648.99
Competitor Two,Lenovo Laptop Flex Gen 5,709.99
Competitor Two,Logitech Headset,65.99
Competitor Three,iPad Mini,249.99
Competitor Three,iPad 10.5,649.99
Competitor Three,Samsung Galaxy Tab,599.99
Competitor Three,Lenovo Laptop Flex Gen 5,689.99
Competitor Three,Logitech Headset,49.99

Then I have another table so I can do the comparison

BaseSites:

LOAD Distinct

SITE as [Base Site]

Resident Data

Where Exists(SITE);

mp802377
Creator II
Creator II
Author

And there also may not be a case where OBJECT is selected. Because they also want to see an overall us vs them. That is why I put OBJECT in a list box and not making it required.

Thank you so much for help on this!

Martha

pradosh_thakur
Master II
Master II

Are you sure this is what the expression iMin({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE)) = 0 can you tell the exact requirement with respect to the data .

Learning never stops.
sunny_talwar

Base Site will have multiple values or is this always one selected value?

mp802377
Creator II
Creator II
Author

The original expression for bar charts is (Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE)). I was trying to put it as if that expression = 0 then with the count.

In the example above, the iPad mini (if chosen) then pie would be split in three ways because there is one that is greater than our companies price, one that is less, and another that matches.

The iPad 10.5 would reflect a pie that has one competitor less ('They Win'), but the others match ('Matched')

Base Site will always have one selected value. It may be us, it may be another company they want to do comparisons against.

sunny_talwar

Got it, how about this

=If(ValueList('We Win','Matched','They Win') = 'We Win',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE)) < 0, 1, 0), OBJECT)),

=If(ValueList('We Win','Matched','They Win') = 'Matched',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE)) = 0, 1, 0), OBJECT)),

=If(ValueList('We Win','Matched','They Win') = 'They Win',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE)) > 0, 1, 0), OBJECT)),

)))

mp802377
Creator II
Creator II
Author

I tried that and got an error. error one.PNG

I removed the = and still got this: It looks like it is erroring out at the 0

error two.PNG

sunny_talwar

You seem to not have OBJECT as a field... what is the field called? You need to replace OBJECT with whatever field you have in your dashboard that tells you iPhone, iPad etc... also remove '=', just like you did

mp802377
Creator II
Creator II
Author

The field name is OBJECT. Is OBJECT a used name that I shouldn't be using?

error three.PNG

I noticed it is erroring out after the 1

error four.PNG