15 Replies Latest reply: Nov 3, 2015 7:01 AM by Christoph Hebig

# Intersection Bar Chart

Hi Community,

I want to create a Bar chart with 2 Bars, 1 shows me a distinct number of articles sold in a specific month (Jan - Dec). Now i want a second bar that shows the number of articles sold in e.g. Dec and Jan, which would be placed on Jan. On Feb i want a bar that shows Intersection of articles of Jan and Feb and so on!

I hope this explanation gives a good view of what i want.

Regards

Chris

• ###### Re: Intersection Bar Chart

can u give me example on this..to understand req good

• ###### Re: Intersection Bar Chart

Yes it gives a view, however, it would be even better if you could share a sample qvw explaining the expected output.

• ###### Re: Intersection Bar Chart

So i say we sold in Jan article           a, b, c, d

in Feb we sold                                 b,c,e

Bar1 shows on Jan: count = 4;  on Feb count = 3

Bar2 shows on Jan: count = 0 (because we have no data on Dec); and on Feb count = 2 (because there are 2 overlapping articles)

Hope this gives you further explanations

Regards

Chris

• ###### Re: Intersection Bar Chart

I am able to do this whole thing in a KPI where i have a specific month given, but i can't make it work in a Bar Chart, cause of the Dimension given from it.

Formula for KPI:

count({\$<Month={\$(vMonth1)}>}Distinct ArticleSold)

+ count({\$<Month={\$(vMonth2)}>}Distinct ArticleSold)

- count({\$<Month={\$(vMonth2), \$(vMonth1)}>}Distinct ArticleSold)

Regards

Chris

• ###### Re: Intersection Bar Chart

This doesn't work in chart, because your comparison in set analysis works outside chart and not row-wise.

• ###### Re: Intersection Bar Chart

Yes, i know that. That's why i'm asking here for help. I posted this formula, only for interest or more ideas

Regards

Chris

• ###### Re: Intersection Bar Chart

Have you checked the qvf attached above?

• ###### Re: Intersection Bar Chart

Yes that would work.

I thought of a way to do this only via set Analysis, but i think this won't work because we got no access on the dimension through set Analysis.

Thank you for this!

Regards

Chris

• ###### Re: Intersection Bar Chart

If you want in front -end you could try expression like:

Count(If(SubStringCount(Aggr( NODISTINCT Above(Concat(Product,';')), Month), Product)>0, Product))

PFA

• ###### Re: Intersection Bar Chart

This looked like correct in first look, then i added a few more data rows and on 3 i got a wrong value

PFA

Regards

Chris

• ###### Re: Intersection Bar Chart

You used wrong expression. Just copy and paste the expression from above.

• ###### Re: Intersection Bar Chart

Yeah nice! now it works!!!

Thank you very much!