# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for
Did you mean:
Partner - Creator III

## 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.

I've created 2 variables. like below.

In the pivot table I created 2 measures:

For last year:

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

For this year

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

Why does the year selection not work?

regards,

Kris

1 Solution

Accepted Solutions
MVP & Luminary

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

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

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

- Marcus

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 - Creator III
Author

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

Try a change by the variable-call like:

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

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

- Marcus

Partner - Creator III
Author

Thanks marcus.

This works for me.

Regards,

Kris

Not applicable

Try the below expressions,

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

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