Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
joanaleao
Contributor
Contributor

set analysis with variable

Hello all,

 

I have  variable (image attached) vteste:

left((Artigo_Coleccao),1)&(right(left((Artigo_Coleccao),3),2)-2) & Right(left((Artigo_Coleccao),6),3)&( Right((Artigo_Coleccao),2)-1)

 

The variable is working fine, but when I use it on this expression:

 

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

or

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

 

the result is always zero.

 

If I substituite the variable by one of the values it works ok, like this:

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

 

What am I doing wrong?

 

image attached with the expected behaviour.

 

Thank you,

Joana Leão

 

Labels (2)
8 Replies
tresesco
MVP
MVP

Try putting '=' sign before $ expansion, like this:

Artigo_Coleccao={'$(=vteste)'}

joanaleao
Contributor
Contributor
Author

same result...

 

Thank you,

Joana Leão

Ilze1
Contributor
Contributor

Have you tried =${'vTeste'}?

tresesco
MVP
MVP

What is the output you are getting for the variable in kpi object?

sunny_talwar

How about this

Artigo_Coleccao = {"$(=$(vteste))"}
joanaleao
Contributor
Contributor
Author

with ${'vTeste'} I have same result in all rows,

and it corresponds the total value of column "Qtd Período LY" (as vtest  is not being read ) (25494 )

 

If you see the attached image,

I should have for each row the value for the corresponding vteste category on col "Qtd Período LY".

On 1st row of last col I should have 20298 , because it's the value of "B28 AW18" on  "Qtd Período LY",

2nd row 354, and so on.

 

Thank you,

Joana Leão

 

 

joanaleao
Contributor
Contributor
Author

$(vteste) in KPI object I get "-".

joanaleao
Contributor
Contributor
Author

but i dont think it's supposed to have a unique  value, because vteste has a different result for each "artigo_coleccao", as in the image attached.