Qlik Community

Qlik Sense Cloud Discussions

danimelo1
New Contributor III

Set analysis over variables in QlikSense

Is it possible to do a set analysis to a variable?

I have a variable called vSOM with something like:

vShareofMarket=

(Sum([MyVolume: Prod1]+[MyVolume: Prod2]))

/

(Sum([Industry Volume: Prod1]+[Industry Volume: Prod2]))


Now, what I want is to have a YoY:

(Sum({<Year={'2017'}>}$(vShareofMarket)) - Sum({<Year={'2016'}>}$(vShareofMarket))) - 1


Is this possible to perform? Or should I have to create one variable for actual year and another one for previous year and operate over them?


Thanks

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Set analysis over variables in QlikSense

May be this

Variables with Parameters

vShareofMarket=

(Sum({<Year = {'$1'}>} [MyVolume: Prod1]+[MyVolume: Prod2]))

/

(Sum({<Year = {'$1'}>} [Industry Volume: Prod1]+[Industry Volume: Prod2]))

and then this

$(vShareofMarket(2017)) - $(vShareofMarket(2016))

2 Replies
MVP
MVP

Re: Set analysis over variables in QlikSense

May be this

Variables with Parameters

vShareofMarket=

(Sum({<Year = {'$1'}>} [MyVolume: Prod1]+[MyVolume: Prod2]))

/

(Sum({<Year = {'$1'}>} [Industry Volume: Prod1]+[Industry Volume: Prod2]))

and then this

$(vShareofMarket(2017)) - $(vShareofMarket(2016))

danimelo1
New Contributor III

Re: Set analysis over variables in QlikSense

Great! Thank You Sunny.