Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Partner
Partner

Sense: Set Analysis with variable

Hello All,

I'm  new to Sense. And I wan't to use set analysis with a variable in a pivot table.

I've created a pivot table with 2 measures. Onde with the data of this year and one withe the data of last year.

Now I get in both columns the same value.

variable2.JPG

I've created 2 variables. like below.

variable.JPG

In the pivot table I created 2 measures:

For last year:

variable3.JPG

expression : sum({ $ <HrAPKO={ 'A' }, Boekjaar = {'(=$(vLastYear))'}>}Bedrag)

For this year

variable4.JPG

expression sum({ $ <HrAPKO={ 'A' }>}Bedrag).

Why does the year selection not work?

regards,

Kris

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Sense: Set Analysis with variable

Try a change by the variable-call like:

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {$(vYear)}>}Bedrag)

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {$(vLastYear)}>}Bedrag)

- Marcus

6 Replies
MVP & Luminary
MVP & Luminary

Re: Sense: Set Analysis with variable

Try to include the current year within the set analysis, too like:

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {'(=$(vYear))'}>}Bedrag)

- Marcus

Re: Sense: Set Analysis with variable

You may forget to add this?

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {'(=$(vYear))'}>}Bedrag)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Partner
Partner

Re: Sense: Set Analysis with variable

Hi Marcus,

Indeed, I've added the set analysis instruction to the measure for this year.

But I had selected 2017 so this data was correct.

I only see the data for 2017 in the column of last year (2016) an the column of this year (2017)

regards,

Kris

MVP & Luminary
MVP & Luminary

Re: Sense: Set Analysis with variable

Try a change by the variable-call like:

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {$(vYear)}>}Bedrag)

sum({ $ <HrAPKO={ 'A' }, Boekjaar = {$(vLastYear)}>}Bedrag)

- Marcus

Partner
Partner

Re: Sense: Set Analysis with variable

Thanks marcus.

This works for me.

Regards,

Kris

Not applicable

Re: Sense: Set Analysis with variable

Try the below expressions,

Sum({$<HrAPKO={ 'A' },Boekjaar={'=Boekjaar=$(vLastYear)'}>}Bedrag)

Sum({$<HrAPKO={ 'A' },Boekjaar={'=Boekjaar=$(vYear)'}>}Bedrag)