damp-yak-43987
04/18/2024, 3:10 AMmitch-dev
and it seems to be crashing the app. I've tried wrapping it in single/double quotes, but still no luck. 😕
https://github.com/evidence-dev/evidence/issues/1906lemon-cricket-39335
04/18/2024, 5:28 PMbright-jordan-14067
04/18/2024, 8:30 PMhandsome-fish-77281
04/19/2024, 1:43 AMhandsome-fish-77281
04/19/2024, 1:44 AM---
# queires that generate the data.
queries:
#--Monthly
- monthly_tech_overtime: technician_overtime/monthly_tech_overtime.sql
- monthly_stat_count: technician_overtime/monthly_stat_count.sql
- total_count_employee: technician_overtime/total_count_employee.sql
#--Weekly
- weekly_tech_overtime: technician_overtime/weekly_tech_overtime.sql
- weekly_stat_count: technician_overtime/weekly_stat_count.sql
- w_total_count_employee: technician_overtime/w_total_count_employee.sql
---
<Grid cols=3 gapSize="sm">
<Dropdown name=year_of_dropdown title="Select Year">
<DropdownOption valueLabel="2024" value=2024 />
<DropdownOption valueLabel="2023" value=2023 />
</Dropdown>
<Dropdown name=season_of_dropdown title="Select Seasonality">
<DropdownOption valueLabel="Monthly" value="Monthly" />
<DropdownOption valueLabel="Weekly" value="Weekly" />
</Dropdown>
<Dropdown name=division_of_dropdown title="Select Maintenance Division">
<DropdownOption valueLabel="VIC" value="VIC" />
<DropdownOption valueLabel="NSW" value="NSW" />
<DropdownOption valueLabel="OLD" value="QLD" />
<DropdownOption valueLabel="SA" value="SA" />
<DropdownOption valueLabel="WA" value="WA" />
<DropdownOption valueLabel="NT" value="NT" />
<DropdownOption valueLabel="TAS" value="TAS" />
<DropdownOption valueLabel="ACT" value="ACT" />
</Dropdown>
</Grid>
{#if inputs.season_of_dropdown.value === 'Monthly'}
<Histogram
data={monthly_tech_overtime}
x=Total_count
yAxisTitle="Number of Observed Technicians"
xAxisTitle="Technician Overtime Instances"
yGridlines=false
colorPalette={['#01bcff','#010320']}
title=""
chartAreaHeight=250
>
<ReferenceLine x={monthly_stat_count[0].outlier} label="Threshold" color=black labelColor=black lineWidth=2/>
<ReferenceArea xMin={monthly_stat_count[0].outlier} xMax={monthly_stat_count[0].max_total_count+10}
label="Unusual Overtime" color='#eeeeee' labelPosition=center labelColor=black />
</Histogram>
_**Insights**_: _<Value data={total_count_employee} column=prob_total_count_employee fmt=pct0 />_ of technicians booked overtime to maintenance more than _<Value data={monthly_stat_count} column=outlier />_ times. The heat map below identifies those technicians and includes the month they booked overtime.
{:else if inputs.season_of_dropdown.value === 'Weekly'}
<Histogram
data={weekly_tech_overtime}
x=Total_count
yAxisTitle="Number of Observed Technicians"
xAxisTitle="Technician Overtime Instances"
yGridlines=false
colorPalette={['#01bcff','#010320']}
title=""
chartAreaHeight=250
>
<ReferenceLine x={weekly_stat_count[0].outlier} label="Threshold" color=black labelColor=black lineWidth=2/>
<ReferenceArea xMin={weekly_stat_count[0].outlier} xMax={weekly_stat_count[0].max_total_count+10}
label="Unusual Overtime" color='#eeeeee' labelPosition=center labelColor=black />
</Histogram>
_**Insights**_: _<Value data={w_total_count_employee} column=prob_total_count_employee fmt=pct0 />_ of technicians booked overtime to maintenance more than _<Value data={weekly_stat_count} column=outlier />_ times. The heat map below identifies those technicians and includes the month they booked overtime.
{:else }
Something completely different.
handsome-fish-77281
04/19/2024, 1:44 AMhandsome-fish-77281
04/19/2024, 1:44 AMhandsome-fish-77281
04/19/2024, 1:54 AMbest-exabyte-32706
04/19/2024, 12:18 PMflat-father-44265
04/19/2024, 3:35 PMflat-father-44265
04/19/2024, 4:12 PMlively-city-63731
04/19/2024, 10:20 PMwooden-needle-36467
04/21/2024, 4:46 AMdazzling-telephone-99947
04/21/2024, 9:20 AMnpm rebuild
, then do the run sources againdazzling-telephone-99947
04/21/2024, 9:21 AMdazzling-telephone-99947
04/21/2024, 3:54 PMnpm run build
) but getting a Build Failed
with Error: 500 /
. Any suggestions on how I can track this down so I can actually solve the problem? 🥹adventurous-gold-51602
04/22/2024, 11:54 AMglamorous-elephant-23682
04/22/2024, 12:31 PMswift-dinner-24920
04/22/2024, 2:32 PMflat-father-44265
04/22/2024, 4:51 PMdelightful-application-94642
04/22/2024, 7:43 PMcalm-country-40626
04/22/2024, 8:10 PMflaky-student-37129
04/23/2024, 12:52 AMstale-agency-85062
04/23/2024, 6:24 PMwhere part_number like '{dropdown.name.value}'
as the sql is written like this where part_number like '%'
• but when i select a part number, the sql is written like this where part_number like '850'
and it returns nothing
I've tried casting the partnumber column as a varchar and the SQL is compiled like this where cast(part_number as varchar) like '850'
but that still returns no records. If i instead change it so the SQL writes like this where part_number = 850
it works, but then the all products on load doesn't work because where part_number like %
does not work without the quotes 🤔able-yak-3257
04/23/2024, 7:50 PMwooden-needle-36467
04/24/2024, 4:17 AMfew-megabyte-66980
04/24/2024, 10:57 AMwonderful-pilot-74030
04/24/2024, 2:19 PMacceptable-actor-27402
04/24/2024, 5:20 PMkind-cartoon-96856
04/25/2024, 12:24 PM<Dropdown
data={jobs_unique}
name=selected_job
value=JobNo
>
<DropdownOption value="%" valueLabel="All Jobs"/>
</Dropdown>
<BarChart
data={totals}
x=entry_month
y=total_hours
title = "Hours by Month"
series="entry_type"
type=grouped
/>
sql:
```sql totals
select
date_trunc('month', Date) as entry_month,
count(*) as number_of_entries,
sum(Hours) as total_hours,
sum(Rate) as total_cost,
Type as entry_type,
JobNo as entry_job
from
entries
where
Hours > 0
and JobNo like '${inputs.selected_job.value}'
group by
entry_month,
entry_type,
entry_job
sql jobs_unique
select
JobNo
from entries
group by 1
```
appreciate the assist, no idea what I've done wrong here