# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
New Contributor III

## how to fetch the count of rows, of the table chart in KPI chart based on dynamic variable value

Hi,

I have a table having fields -Test Name,Selection Priority,Rank,Duration and cumulative total, based on the slider variable values(Dynamic), the table should show the cumulative total.

for example: i have set the slider variable value to 213, the table should show me the records having cumulative total less than 213.

but i have to show in the KPI chart, the count of rows in the table,for slider variable value to 213.. the count of rows is 1057.

Can any one please give me the expression to use in the KPI chart? to fetch count of rows in the table based on dynamic value of slider variable.

for ex: i set the slider variable value to 89, the count of rows KPI should show me the count of rows in the table.

Attached is the QVF.

1 Solution

Accepted Solutions
Contributor III

## Re: how to fetch the count of rows, of the table chart in KPI chart based on dynamic variable value

Hi Heena,

You should use set analysis in your expression.

Cumulative Total Expression in table (If it doesn't exist in your data set):

max(aggr(if(RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL))) <= \$(v_Days),
RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL)))
),[Test Name]))

Count Of Row Expression on KPI:

Count({<[Test Name]={"=max(aggr(if(RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL))) <= \$(v_Days),RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL)))),[Test Name]))<\$(v_Days)"}>}"Test Name")

You can check attached qvf.

Hope it helps..

3 Replies
Valued Contributor III

## Re: how to fetch the count of rows, of the table chart in KPI chart based on dynamic variable value

add rownum() to script or table

Channa
Contributor III

## Re: how to fetch the count of rows, of the table chart in KPI chart based on dynamic variable value

Hi Heena,

You should use set analysis in your expression.

Cumulative Total Expression in table (If it doesn't exist in your data set):

max(aggr(if(RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL))) <= \$(v_Days),
RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL)))
),[Test Name]))

Count Of Row Expression on KPI:

Count({<[Test Name]={"=max(aggr(if(RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL))) <= \$(v_Days),RangeSum(Above(TOTAL (Duration), 0, RowNo(TOTAL)))),[Test Name]))<\$(v_Days)"}>}"Test Name")

You can check attached qvf.

Hope it helps..

New Contributor III

Thanks!!