Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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.
I've loaded your qvw with binary and added calculations like:
NoConcatenate
Loaded:
load *, Team &'|'& day_month_year as joinKey Resident Data;
drop table Data;
Status:
load
joinKey
, DoneQuantity/Quantity as DonePercent
;
load
joinKey
, sum(match(Status, 'Done')) as DoneQuantity
, count(DISTINCT ID) as Quantity
Resident
Loaded
group by
joinKey
;
left join(Loaded)
load * Resident Status;
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 🙂
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.
I've loaded your qvw with binary and added calculations like:
NoConcatenate
Loaded:
load *, Team &'|'& day_month_year as joinKey Resident Data;
drop table Data;
Status:
load
joinKey
, DoneQuantity/Quantity as DonePercent
;
load
joinKey
, sum(match(Status, 'Done')) as DoneQuantity
, count(DISTINCT ID) as Quantity
Resident
Loaded
group by
joinKey
;
left join(Loaded)
load * Resident Status;
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 🙂
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 :