Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
jasonwills
New 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

Tags (1)
1 Solution

Accepted Solutions
Highlighted
vinieme12
Esteemed Contributor II

Re: Best way to configure load statement for Pie Chart

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

View solution in original post

8 Replies
Highlighted
sergio0592
Valued Contributor II

Re: Best way to configure load statement for Pie Chart

Is it what you are trying to achieve?

Highlighted
robin_hausdoerfer
Valued Contributor III

Re: Best way to configure load statement for Pie Chart

be careful using expressions like Sales1 + Sales2 + Sales3

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

Highlighted
sergio0592
Valued Contributor II

Re: Best way to configure load statement for Pie Chart

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

Highlighted
robin_hausdoerfer
Valued Contributor III

Re: Best way to configure load statement for Pie Chart

rangesum(Sales1,Sales2,Sales3) ...

Highlighted
jasonwills
New Contributor II

Re: Best way to configure load statement for Pie Chart

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

Highlighted
vinieme12
Esteemed Contributor II

Re: Best way to configure load statement for Pie Chart

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

View solution in original post

Highlighted
vinieme12
Esteemed Contributor II

Re: Best way to configure load statement for Pie Chart

Read more here

The Crosstable Load

Highlighted
jasonwills
New Contributor II

Re: Best way to configure load statement for Pie Chart

Hi Vineeth,

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

Jason