Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kris_vliegen
Partner - Creator III
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.

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
marcus_sommer

Try a change by the variable-call like:

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

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

- Marcus

View solution in original post

6 Replies
marcus_sommer

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

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

- Marcus

Anil_Babu_Samineni

You may forget to add this?

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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
kris_vliegen
Partner - Creator III
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

marcus_sommer

Try a change by the variable-call like:

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

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

- Marcus

kris_vliegen
Partner - Creator III
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)