Qlik Sense App Development

New Contributor III

use variable within set analysis

Hi.

can anybody help me? )

MyFieldFromOtherTableSumFieldFromOtherTable
95100.00
96200.00
97300.00

MyFieldFromChartcalculation sum (((
95here must be 100
96here must be 200

This construction works in chart:    Sum({<MyFieldFromOtherTable={95}>} SumFieldFromOtherTable)  (in all row sum equal 100 )

This construction don't works in chart:    Sum({<MyFieldFromOtherTable={MyFieldFromChart}>} SumFieldFromOtherTable)

4 Replies
MVP

Re: use variable within set analysis

It depends on how MyFieldFromChart is defined. you could try

Sum({<MyFieldFromOtherTable={'\$(MyFieldFromChart)'}>} SumFieldFromOtherTable)

or

Sum({<MyFieldFromOtherTable={"\$(=MyFieldFromChart)"}>} SumFieldFromOtherTable)

If these do not work, I suggest you post more detail about the variable and your data model. the best would be a small sample qvw/qvf file that illustrates the problem.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
New Contributor III

Re: use variable within set analysis

Sorry for the pause.

both variants don't work

(Sum({<MyFieldFromOtherTable={'\$(MyFieldFromChart)'}>} SumFieldFromOtherTable)  and Sum({<MyFieldFromOtherTable={"\$(=MyFieldFromChart)"}>} SumFieldFromOtherTable)

Contributor II

Re: use variable within set analysis

Hi Ihor,

In the sample you have provided, the 2 tables are not linked. You could link the 2 tables and then use a simple sum(SumFieldFromOtherTable).

"

table1:

MyFieldFromOtherTable,SumFieldFromOtherTable

95,100.00

96,200.00

97,300.00

];

table2:

MyFieldFromChart,MyFieldFromOtherTable

96,96

95,95

];

"

New Contributor III

Re: use variable within set analysis

Could of course. But I did not want to be through a link. It was other task.

I think "set analysis" can not cope.

Thank you all )))))