Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
letileti
Contributor III
Contributor III

How to create dimension for use pie chart

Dear all

Another challenge in my Qlik Sense journey.

I want to create a pie chart showing which portion of the Budget is allocated vs. what is remaining.

In my data, I have no 'dimension' for this - as this is embedded in the measures itself (columns).

Should I solve this via the crosstable function (in script) or is there another easier way to tackle this?

My data comes like:

Department, Budget, Budget - allocated, Budget - remaining

Finance,100, 20, 80

My pie chart would simply show:

20 Allocated and 80 Remaining

Many thanks for your thoughts on this!

1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

in pie chart you could use a calculated dimension as below:

ValueList('Allocated','Remaining')  for budget type

and then in your expression something as below:

if( ValueList('Allocated','Remaining') = 'Allocated',

yourExpressionForAllocatedBudget, yourExpressionForRemainingBudget )

I hope it helps.

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

you can create a pie Chart, two expressions (sum(Budget) and sum(Budget - remaining)) with a dimension

=' '

but I think better would be crosstable (Budget, Budgettype) load * from Data

then pie chart,

Dimension Budgettype,

Expression sum({<Budgettype = {'Budget','Budget - remaining'}>} Budget)

Regards

agigliotti
Partner - Champion
Partner - Champion

in pie chart you could use a calculated dimension as below:

ValueList('Allocated','Remaining')  for budget type

and then in your expression something as below:

if( ValueList('Allocated','Remaining') = 'Allocated',

yourExpressionForAllocatedBudget, yourExpressionForRemainingBudget )

I hope it helps.

letileti
Contributor III
Contributor III
Author

‌thanks a lot Andrea!

your suggested approach is simple to implement and works great!

just tested it

agigliotti
Partner - Champion
Partner - Champion

Great!

Could you please mark the answer as correct to help other members?

Thanks.