Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ivostapchuk
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
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
ivostapchuk
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)

karthiksrqv
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:

Load * Inline [

MyFieldFromOtherTable,SumFieldFromOtherTable

95,100.00

96,200.00

97,300.00

];

table2:

Load * Inline [

MyFieldFromChart,MyFieldFromOtherTable

96,96

95,95

];

"

ivostapchuk
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 )))))

Community Browser