Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
JulienM
Contributor II
Contributor II

SUM in CHART doesn't work as expected

Hello,

I'll try to be as precise as I can.

I'm doing a sales turnover analysis. I have an xml file made like this:

JulienM_0-1691142511445.png

When an invoice has only one line / item, everything works fine.

When, like in the screenshot, an invoice ( for example KV1206872) has more than one item, if I make a simple table with invoice number, item etc, I can see there are two items sold.

JulienM_1-1691142851945.png

 



If I do a chart, only one item. The expressions are the issue.

Reading different posts, I made this expression:

=Sum(aggr(sum(TOTAL <invoice_Number> gross_Amount), invoice_Number,item_Code))


Now I can see the two items, but with the same quantity, gross_Amount etc...:

JulienM_2-1691143070816.png


Do I have to make changes in the XML files. Or is there a way to make an expression that works?

Thank you.

Labels (1)
5 Replies
marcus_sommer

Just use: sum(gross_Amount)

JulienM
Contributor II
Contributor II
Author

Hello Marcus,

 

Thank you for your help.

But I wouldn't have written if it was so simple.

It's what I did in first place, but as I said, if I simply use sum(grossAmount), I only see one itemand not two of them:

JulienM_0-1691154209154.png

 

marcus_sommer

In regard to the expression it should be so simple. If the data doesn't fit to your expectation anything else is wrong respectively different to show your wanted view (any further selections, alternate states, synthetic keys and/or circular loops in the data-model, missing key-values to any related associations, ...).

If I look on your xml the values for ...136 are different to those from ...134 and so both couldn't have the same results like in your screenshot.

JulienM
Contributor II
Contributor II
Author

I have three xml files, one for Items list, one for customers list and then one for Sales.

Item code and Customer code are my key-values. I don't have any synthetic keys.

Like I said, I don't understand that I can see in a simple table, for this particulare invoice, the two items.

But in the chart table, with the expression, I only can see one item of two.

I'll check if I can do my script in another way.

marcus_sommer

Something isn't right within your associations. I think you will see it if you extend the table-box for the period-field and the measure fields as well as all fields in which you have currently set any selection.