Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Arjunarao
Honored Contributor II

Bar Chart - Use measure as dimension

Hi All,

I have the Month dimension and 4 measures (Sales,Accounting,Marketing and Finance).

How to use measure as dimension and show the data in bar chart as shown below?

Capture.PNG

Data:

Load * Inline [

Month,Sales,HR,Accounting,Finance

Jan,80,47,61,19

Feb,78,42,63,19

Mar,72,36,60,17

Apr,73,35,62,17

May,81,42,65,20

Jun,84,40,63,20

Jul,72,35,60,17

Aug,80,40,58,19

Sep,77,45,63,21

Oct,81,42,65,20

Nov,84,40,63,20

Dec,72,35,60,17

];

Thanks in advance.

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Bar Chart - Use measure as dimension

Hi,

Please find attached file for solution.

Regards,

Jagan.

8 Replies
MVP & Luminary
MVP & Luminary

Re: Bar Chart - Use measure as dimension

Hi,

Please find attached file for solution.

Regards,

Jagan.

MVP & Luminary
MVP & Luminary

Re: Bar Chart - Use measure as dimension

Used this script

Data:

CrossTable(Department, Value)

Load * Inline [

Month,Sales,HR,Accounting,Finance

Jan,80,47,61,19

Feb,78,42,63,19

Mar,72,36,60,17

Apr,73,35,62,17

May,81,42,65,20

Jun,84,40,63,20

Jul,72,35,60,17

Aug,80,40,58,19

Sep,77,45,63,21

Oct,81,42,65,20

Nov,84,40,63,20

Dec,72,35,60,17

];

and in chart

Dimension: Department, Month

Expression: Sum(Value)

Hope this helps you.

Regards,

Jagan.

balrajahlawat
Esteemed Contributor

Re: Bar Chart - Use measure as dimension

Nothing to do...

Just take Department & Month as a dimension

and sum(sales) as Measure....

MVP
MVP

Re: Bar Chart - Use measure as dimension

PFA

Re: Bar Chart - Use measure as dimension

Dimensions:

1) ValueList('Sales','Accounts','Finance','HR')

2) Month

Expression :

=pick(match(ValueList('Sales','Accounts','Finance','HR'),'Sales','Accounts','Finance','HR'),

sum(Sales),sum(Accounting),sum(Finance),sum(HR))

Capture.JPG

MVP
MVP

Re: Bar Chart - Use measure as dimension

It seems, you really like this valuelist()/valueloop() functions (seen, you resolving few more issues with them here). However, it is suggested not to use them unless there is no other way at all. Because, as you might know, this method is too non-dynamic; maintenance-costly...

MVP & Luminary
MVP & Luminary

Re: Bar Chart - Use measure as dimension

Hi,

You can also use ValueList() but it is a kind of hardcoding and complicated process.  If the data is huge you will get performance issues.

Regards,

Jagan.

Re: Bar Chart - Use measure as dimension

Yes, but it is not always the case. If your synthetic dimensions are fixed and amount of data is not so large it is easy to implement. Sometimes developer may not have rights to change the script or script is too complex so instead of doing changes in script developer may need to choose frond end solution.