12 Replies Latest reply: Sep 27, 2016 3:27 AM by Eric Hannert

# complex calc in barchart

Hi comm,

i have a bar chart in which i want to show the ratio between sales and retoure of an article.

The article is the articlename plus the size. Its a combined Dimension btw.

My problem is that in the database every article is unique, so i have an articlenumber that unique and i need to do the calc over the articlenumber. But i cant show it in the chart cause its to big. Thats why i have articlename and size as dimension.

So i have sum of sales and sum of retoure like:

Sum({\$<[art_ret]= {'sale'}>} amount_RET) //same with retoure just change {'retoure'}

but i dont know how to aggr with my articlenumber when articlename and size are a dimension.

Hope someone can help, thanks in advance!!

-Eric

• ###### Re: complex calc in barchart

I am not sure that I understand your data - if every article is associated with a name and with a size, then your expression should work. To get the ratio, you would need:

=Sum({\$<[art_ret]= {'retour'}>} amount_RET) / Sum({\$<[art_ret]= {'sale'}>} amount_RET)

If that is not working then your data is nor organised the way I thought. You might want to provide extra information, preferably a small sample with some representative data the the chart that you are trying to build.

• ###### Re: complex calc in barchart

the problem is that u can sell an article and retoure it and the same article can then be sold again.Thats why u need the articlenumbe rin calc!!

• ###### Re: complex calc in barchart

Maybe it makes sense to create a "real field" in the data model instead of using calculated dimension.

• ###### Re: complex calc in barchart

i dont calc the dimension.

sorry for my bad english but I want to calc this as my measure!

• ###### Re: complex calc in barchart

I think i have a problem with my calc!!!

Sum({\$<[art_ret]= {'sale'}>} amount_RET)

This calc gives me the amount of both "retoure" and "sale" back but it should only give me the amount of "sale"!!

Someone see the problem with my syntax

• ###### Re: complex calc in barchart

Eric is your data model well connected? If it isn't then that could be one of the reason that set analysis doesn't work. Would you be able to share a sample to further investigate this?

• ###### Re: complex calc in barchart

the RET table is the only table and it is not connected

• ###### Re: complex calc in barchart

RET table is the only table in your database? So you have just one table which includes all the fields?

• ###### Re: complex calc in barchart

I am confused if [art_ret]= {'sale'} gives you sales and returns (retour). What does [art_ret]= {'retour'} give you?

I think you would be better off uploading a small sample app with some representative data.

• ###### Re: complex calc in barchart

like I stated above it doesnt matter because it allways gives me back everything.

The problem is the syntax i my eyes. Because the data cant be ´the problem because there is no other table!!!!

• ###### Re: complex calc in barchart

So does this also give you all the data?

Sum({\$<[art_ret]= {'retour'}>} amount_RET)

• ###### Re: complex calc in barchart

i used an other coloum now and it works!!

mistake from me sorry for that!!!