Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Stacked chart with calculated cycle

Capture.PNG.png

Hi!

I'm trying to create a chart that shows the number of sites divided by their status. The thing is that one site has multiple machines and the status comes from the machines so one site might have multiple statuses. The problem is shown in the picture. There is only one site in the picture but because it has to statuses the chart shows that their is two sites. Is there an expression I could use or some other way to create this kind of view so that the total amount of sites wouldn't be duplicated but all the statuses would show? I would like it still to be like this horizontally.

At the moment the expression of the chart is just COUNT(DISTINCT([Site Code])).

Thanks for your help!

Regards,

Heidi

7 Replies

Re: Stacked chart with calculated cycle

Hi Heidi, if one site has two machines, one operating and one shutdown, wich status should count? or it is 0,5 for each status?

Not applicable

Re: Stacked chart with calculated cycle

0,5 for each! But some sites might have even more than two status..

jsaradhi
Valued Contributor

Re: Stacked chart with calculated cycle

if i understand your question correctly, you need the expression below:

Count(DISTINCT [Site Code])/Count(TOTAL <[Site Code]> DISTINCT Status)

replace your current expression with above expression and see if that is what you need. of course, modify as you see fit for your field names.

Not applicable

Re: Stacked chart with calculated cycle

Didn't help. The site is still shown as two. I want the x-axes to show one if there is only one site selected (as is selected in the picture), and the bar to be divided between the statuses.  

jsaradhi
Valued Contributor

Re: Stacked chart with calculated cycle

may be a sample data set will help as i have a couple of questions - what is your dimension - Area? How is Area related to Site Code? that's why i said you may have to modify the expression to match your fields.

Re: Stacked chart with calculated cycle

Try:

Sum(Aggr(Count(DISTINCT Site)/count(TOTAL <Area, Site> Machine) ,Area, Site, State))

In a simple sample works for me.

You need to change "Site", "Area" and "State" for your name fields

ashwanin
Valued Contributor

Re: Stacked chart with calculated cycle

Hi

I have doubt that , i didn't clearly get your requirement. But i think below will solve your problem.

Community Browser