Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
joanaleao
Contributor
Contributor

Sum without filters but dimension equal to variable

Hello Everyone,

I have a table with values of each collection in different periods of time.

I want to add a column with values of an equivalent collection from last year:

clipboard_image_0.png

For each collection (1):

2 - quantity sold for a given period of time (collection 29 has 864 units)

3 - quantity sold of same period from last year (collection 29 has 0 units)

sum({$<Data_Chave = {">=$(vMinData) <=$(vMaxData)"}, TipoLinha_Codigo={1}>} Venda_LT_Quantidade)

I want to add a column (5) similar to  3 but for another collection.

This collection is calculated in a variable:

4 - $(vteste) = collection – 2

So, for 1st row I should have 803 units (value from collection 27 last year – 2nd row column 3)

I was trying with this expression, similar to 3 but with total to eliminate filters and collection assigned to $(vtestes):

sum( total {$<Data_Chave = {">=$(vMinData) <=$(vMaxData)"}, TipoLinha_Codigo={1}, Colecção = {"=$(vteste)"}>}  Venda_LT_Quantidade)

But with this expression column 5 has value 949 (total of column 3) in all rows.

 

Can anyone help me?

Thank you.

Joana Leão

0 Replies