Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Missing accumulated values in BarChart

Hello everybody,

I try to create a chart that shows my individual transactions in accumulated manner. The presentation takes place in two different categories.

Problem: For Channel = Geldanlage payments do not take place every month.

Thus, the sum is not continuously aggregated, but only if payments were made this month.

The green bars on the Chart should be shown aggregated in every month.

Is there a way to fix this by an Expression?

My actual Expression is sum(Amount)

Unbenannt2.PNG

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can either create records for all combinations of Mon and Bu (with NULL or zero for Sales), or look into the AsOf table concept:

The As-Of Table

Using an as-of table should help you to get your Sales values correctly accumulated, see attached.

AsOfAccumulation.png

View solution in original post

6 Replies
swuehl
MVP
MVP

It's a little unclear how your data model and data look like and where the accumulation of Rente takes place.

Maybe something like

=Sum({<Channel = {Rente}>} Betrag) +

RangeSum(Above( Sum({<Channel = {Geldanlage}>} Betrag),0,Rowno()))

Anonymous
Not applicable
Author

try this expression: Rangesum(above(sum(Sales),0,RowNo()))

for more detail refer below example:

LOAD * INLINE [

    Mon, Sales , Bu

    jan, 40, A

    feb, 23, A

    mar, 42, A

    apr, 78, A

    may, 12, A

    jun, 45, A

    jul, 85, A

    aug, 66, A

    sep, 77, A

    oct, 44, A

    nov, 76, A

    dec, 75, A

    jan, 50, B

    feb, 20, B

    mar, 0, B

    apr, 0, B

    may, 0, B

    jun, 0, B

    jul, 0, B

    aug, 0, B

    sep, 45, B

    oct, 60, B

    nov, 70, B

    dec, 80, B

];

Exp: Rangesum(above(sum(Sales),0,RowNo()))


Img1.PNG

amayuresh
Creator III
Creator III

Due to missing value for Channel=Rente and for that perticular date/month, chart is not calculating the sum

Anonymous
Not applicable
Author

Hi daniel,

As you do not have amount for some months and because of that accumulation for month where amount =0 is not visible in your chart.

to resolve this you can use below expression :

if(sum(Sales)=0,0.0001,Sum(Sales))

need to set number format of this exp to "fixed to 0"

Img1.PNG

Not applicable
Author

Thank you for your help.

Your idea sounds good.

But if I take out line aug, 0, B  from your data set, then we have my Problem.


LOAD * INLINE [

Mon, Sales , Bu
jan, 40, A
feb, 23, A
mar, 42, A
apr, 78, A
may, 12, A
jun, 45, A
jul, 85, A
aug, 66, A
sep, 77, A
oct, 44, A
nov, 76, A
dec, 75, A
jan, 50, B
feb, 20, B
mar, 0, B
apr, 0, B
may, 0, B
jun, 0, B
jul, 0, B

sep, 45, B
oct, 60, B
nov, 70, B
dec, 80, B
]
;
1.PNG

swuehl
MVP
MVP

You can either create records for all combinations of Mon and Bu (with NULL or zero for Sales), or look into the AsOf table concept:

The As-Of Table

Using an as-of table should help you to get your Sales values correctly accumulated, see attached.

AsOfAccumulation.png