Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jasonwills
Contributor II
Contributor II

Best way to configure load statement for Pie Chart

CountryMonthSales1Sales2Sales3
United KingdomJan500060004500
United KingdomFeb430030004000
United KingdomMar600045004500
United KingdomApr290070005000
FranceJan400040003000
FranceFeb400020003100
FranceMar450015003500
FranceApr300055003700

Hi All,

i am after some advice on the best way to do a load statement for the above - this is in an excel file.

I am currently importing this OK, and use Country and Month as filters, however, my current load statement works for my qlikview file, but is not quite right to get a pie chart with percentages.

So, i'll have United Kingdom selected for a filter, and Jan for example, what i'd like the pie chart to then show is Sales1, Sales2 and Sales 3 as a percentage of the total for those 3 categories.

And for that to obviously change dependant on the country or the month that i select.

I cannot figure how best to do a new load statement to handle this, so any advice is much appreciated.

Regards

Jason

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

You need to do a crosstable load

Crosstable (Saletype, Saleavalue,2)

Load

Country,

Month,

Sale1,Sale2, Sale3

From xxxx;

Now for pie chart use Saletype as dimension and sum (salevalue) as expression

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

8 Replies
sergio0592
Specialist III
Specialist III

Is it what you are trying to achieve?

Anonymous
Not applicable

be careful using expressions like Sales1 + Sales2 + Sales3

If only 1 field isnull() you'll get null() as return value!

sergio0592
Specialist III
Specialist III

You're right, but what is the way to avoid that?

Anonymous
Not applicable

rangesum(Sales1,Sales2,Sales3) ...

jasonwills
Contributor II
Contributor II
Author

Hi Jean-Baptiste,

i was hoping not to do this as an 'in-line' as this is just a sample set, and there may be 12 months for each conutry, and loads of countries...

Once i can get the data in there, i was then planning to se it in a pie chart to show percentages and values.

Thanks for all commetns up till now.


Regards

Jason

vinieme12
Champion III
Champion III

You need to do a crosstable load

Crosstable (Saletype, Saleavalue,2)

Load

Country,

Month,

Sale1,Sale2, Sale3

From xxxx;

Now for pie chart use Saletype as dimension and sum (salevalue) as expression

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

Read more here

The Crosstable Load

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
jasonwills
Contributor II
Contributor II
Author

Hi Vineeth,

perfect, thankyou very much, i always forget about the CrossTable, exactly what was needed, many thanks for the help.

Jason