Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP
MVP

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

Artigo_Coleccao={'$(=vteste)'}

Highlighted
Contributor
Contributor

same result...

 

Thank you,

Joana Leão

Highlighted
Contributor
Contributor

Have you tried =${'vTeste'}?

Highlighted
MVP
MVP

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

Highlighted

How about this

Artigo_Coleccao = {"$(=$(vteste))"}
Highlighted
Contributor
Contributor

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

 

 

Highlighted
Contributor
Contributor

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

Highlighted
Contributor
Contributor

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.