# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
cancel
Showing results for
Did you mean:
Contributor III

## Use Slider as filter

I am trying to use a slider to filter my chart.

I have a calculation

=Count(Distinct {\$<Status={'Done'}>}ID)/Count(DISTINCT ID)

This will be a percentage value range from 0% to 100%.

I want a slider to filter the % range.  So I can filter anything below 50% or anything between 90% & 100% etc.

I need help with setting this up.

Sample is attached.

1 Solution

Accepted Solutions
Creator II

Hi.

In my opinion the simpliest way is to calculate the % in load script and then prepare the set analisys based on sliders with two variables for lower and upper bound.

``````NoConcatenate
load *, Team &'|'& day_month_year as joinKey Resident Data;

drop table Data;

Status:
joinKey
, DoneQuantity/Quantity as DonePercent
;
joinKey
, sum(match(Status, 'Done')) as DoneQuantity
, count(DISTINCT ID) as Quantity
Resident
group by
joinKey
;

drop table Status;
drop field joinKey;``````

Then added two variables: lowerBound, upperBound.

Set the slider for: VariableBased, MultipleValues
Min. value: 0
Max. value: 1
Static step: 0.1
In pivot added to expressions: {<DonePercent={">=\$(lowerBound)<=\$(upperBound)"}>}

Column 'Count': Count({<DonePercent={">=\$(lowerBound)<=\$(upperBound)"}>} DISTINCT ID)
Column 'Done': Count(Distinct {\$<Status={'Done'}, DonePercent={">=\$(lowerBound)<=\$(upperBound)"} >}ID)
Column '%Done': column(2)/column(1)

See the attached file. I didn't have the csv file so i've loaded yours qvw binary (as mentioned before).
Hope this help 🙂

2 Replies
Creator II

Hi.

In my opinion the simpliest way is to calculate the % in load script and then prepare the set analisys based on sliders with two variables for lower and upper bound.

``````NoConcatenate
load *, Team &'|'& day_month_year as joinKey Resident Data;

drop table Data;

Status:
joinKey
, DoneQuantity/Quantity as DonePercent
;
joinKey
, sum(match(Status, 'Done')) as DoneQuantity
, count(DISTINCT ID) as Quantity
Resident
group by
joinKey
;

drop table Status;
drop field joinKey;``````

Then added two variables: lowerBound, upperBound.

Set the slider for: VariableBased, MultipleValues
Min. value: 0
Max. value: 1
Static step: 0.1
In pivot added to expressions: {<DonePercent={">=\$(lowerBound)<=\$(upperBound)"}>}

Column 'Count': Count({<DonePercent={">=\$(lowerBound)<=\$(upperBound)"}>} DISTINCT ID)
Column 'Done': Count(Distinct {\$<Status={'Done'}, DonePercent={">=\$(lowerBound)<=\$(upperBound)"} >}ID)
Column '%Done': column(2)/column(1)

See the attached file. I didn't have the csv file so i've loaded yours qvw binary (as mentioned before).
Hope this help 🙂

Specialist II

Hi @sqlpuzzle , you can create first a variable : vP in this case

Then Configure your chart, a pivot table in this case, telling it what to show , usig the variable :

And then configure your slider like this :

QFabian