Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

warrentk80
New Contributor III

Set Analisys

Hello to all

I need to include in the syntax by SET analisys a field or variable in the comparison instead of a string, but the formula gives me error.

here is the formula that I use:

sum ({$ <[Year] = {'2014 '}>} orders) so it works

but I would need to use after = a field where I select more years.

then sum ({$ <[Year] = {[elencoanni]}>} orders)


how should I do?

thanks

Best Regards

Andrea

1 Solution

Accepted Solutions
hrlinder
Honored Contributor

Re: Set Analisys

  you need to use the concat function

sum({$<yourdate={"$(=concat(selecteddates,'","'))"} >}Value

8 Replies
hrlinder
Honored Contributor

Re: Set Analisys

  you need to use the concat function

sum({$<yourdate={"$(=concat(selecteddates,'","'))"} >}Value

Re: Set Analisys

If you have to select more years then write like

sum ({$ <[Year] = {'2014','2013','2012'}>} orders)




senpradip007
Valued Contributor III

Re: Set Analisys

If you want the result for a particular year you could use like sum ({$ <[Year] = {'2014 '}>} orders) which you have already done. But if you want more than one value on the basis of [elencoanni] dimenssion, you don't need to use set analysis.

adrianbuzer
Contributor II

Re: Set Analisys

If it is a variable then try

sum({<Year={"$(elencoanni)"}>}Orders)

sureshbaabu
Contributor III

Re: Set Analisys

Hello,

You can use variables as below on a set analysis expression

Variable: Vmaxyear= max(year)

Expression : SUM({$Year={'$(Vmaxyear)'}>}Orders)

Hope this helps!!

Thanks

rajeshvaswani77
Valued Contributor III

Re: Set Analisys

Hi Andrea,

Declare a variable. Have the year assigned to this.

Then your set expression will be

sum ({$ <[Year] = {"=$(velencoanni)"}>} orders)

thanks,

Rajesh Vaswani

gupta_n8
Valued Contributor II

Re: Set Analisys

sum ({$ <[Year] ={$(=GetFieldSelections([elencoanni]))} >} orders)

chauhans85
Esteemed Contributor

Re: Set Analisys

sum({$<Year={$(=Getfieldselections(Year)} >}Value)


or


sum({$<Year={"$(=Getfieldselections(Year)"} >}Value)


or


sum({$<Year={'$(=Getfieldselections(Year)'} >}Value)


or

sum({$<Year={$(=concat(Year,","))} >}Value)


or

sum({$<Year={"$(=concat(Year,","))"} >}Value)

Community Browser