Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

Set Analisys take an element

I want to do this set analisys taking a value from my list box,

when i choose "CESSAZIONE" and "RECESSO" in my list box

this set analisis work if i choose ONE of those two elements:

Sum({<DATA_OUT={"=Aggr(Max(DATA_OUT), MESEOUT, COD_PUNTO)"},STATO_OUT={"$(=GetFieldSelections(STATO_OUT))"} -  {'SCADENZA'}>} CONSUMO_TOT_ANNUO),

but if i choose ALL TWO elements ("cessazione" and "recesso") this not work, no rows return...... why?

thanks

1 Solution

Accepted Solutions
danosoft
Specialist
Specialist
Author

hi, i find the errror in set analisys:

Sum({<DATA_OUT={"=Aggr(Max(DATA_OUT), MESEOUT, COD_PUNTO)"},STATO_OUT={$(=chr(39) & concat(distinct STATO_OUT, chr(39) &', ' & chr(39)) & chr(39) )} -  {'SCADENZA'}>} CONSUMO_TOT_ANNUO),

in this way it work

need after STATO_OUT an =

View solution in original post

7 Replies
Anonymous
Not applicable

I suppose that it's because getfieldselections separtes the tiems with a commy

like CESSAZIONE, RECESSO

but Set Analysis requires 'CESSAZIONE','RECESSO'

try

like =chr(39) & concat(distinct STATO_OUT, chr(39) &', ' & chr(39)) & chr(39) 

Sum({<DATA_OUT={"=Aggr(Max(DATA_OUT), MESEOUT, COD_PUNTO)"},STATO_OUT{$(=chr(39) & concat(distinct STATO_OUT, chr(39) &', ' & chr(39)) & chr(39) )} -  {'SCADENZA'}>} CONSUMO_TOT_ANNUO),

I hope that the Syntax is correct ( I tried it with my own set analysis and it worked)

danosoft
Specialist
Specialist
Author

sorry but it not worked, no rows returned

Anonymous
Not applicable

can you send example qvw?

danosoft
Specialist
Specialist
Author

in this way it not work in all case:

1. when i choose one value

2. when i choose the two values

3. when i not choose values (when i not choose values it need to show the same rows when i choose the two values)

danosoft
Specialist
Specialist
Author

hi, i find the errror in set analisys:

Sum({<DATA_OUT={"=Aggr(Max(DATA_OUT), MESEOUT, COD_PUNTO)"},STATO_OUT={$(=chr(39) & concat(distinct STATO_OUT, chr(39) &', ' & chr(39)) & chr(39) )} -  {'SCADENZA'}>} CONSUMO_TOT_ANNUO),

in this way it work

need after STATO_OUT an =

Anonymous
Not applicable

can you define Expression chr(39) & concat(distinct STATO_OUT, chr(39) &', ' & chr(39)) & chr(39) into as text object and see the Output. it should be like 'CESSAZIONE','RECESSO'

your third condition would not be fulfilled with this Expression. I would try with getselectedcount(STRATO_OUT) = 0 and do something different

Anonymous
Not applicable

great, didn't see that while pasting