11 Replies Latest reply: Jun 2, 2017 7:47 AM by Petr Kyncl

# How to set sum of a column as the value of a column

I am making a pivottable. I have diffrent types of articles as rows. Som of the articles are specially marked in [no1] as 1.

I have made a column that shows how many of my special products i have sold. Now - i want to make a column that shows total of sold special products - regardless of product number. In the example below, that column will show 7072 in each single cell.

Is that possible? I have tried a litte bit of stacked aggregation, but with no luck so far.

• ###### Re: How to set sum of a column as the value of a column

Hello Felix,

put this expresion Aggr(sum( {<[no1]={1}>} count),Group) as Dimension to your table.

Group is dummy diminension define in the script, which aggr all of records to one group:

*,

'All'              as Group

From ABC

My test table:

If you have .qvf of my example, please let me know.

BR,

Petr

• ###### Re: How to set sum of a column as the value of a column

Thank you so much for your time!

Unfortunatly, i dont get it yet.

I dont really understand how the i add the piece of code as dimension. Am I supposed to add it in data import?

Please, see attached .qvf.

I want the measure Aggr(sum({Sale={Yes}>}Count),Group) to show 61 for A, 16 for B and 25 for C, in the whole columns.

• ###### Re: How to set sum of a column as the value of a column

Hi Felix,

Can you append QVF with a piece of your data?

Regards,

Andrey

• ###### Re: How to set sum of a column as the value of a column

Thank you so much! I have added a .qvf in the post above.

• ###### Re: How to set sum of a column as the value of a column

Anyone?

• ###### Re: How to set sum of a column as the value of a column

Sorry for delay.

Put following expresion as column:

Aggr(sum( {< Sale = {'Yes'} >} Count),Customer)

P

• ###### Re: How to set sum of a column as the value of a column

Thank you so much for your help.

If i move our new formula to be used as a measure, i will get this result.

Are there any way for me to get this result?

I want to relate number of sold products of a specific product to the total number of products sold on sale.

• ###### Re: How to set sum of a column as the value of a column

I want the whole columns to show same value. I didn't mean to make some numbers negative, as in the picture above.

• ###### Re: How to set sum of a column as the value of a column

Well,it should be done. I solved in script part.

• ###### Re: How to set sum of a column as the value of a column

Assuming the value 1 or 0 in [no1]:

Sum({<[no1] = {1}>} [no1])