-- Add the T-SQL statements to compute the return value here
SET @DEDUCTIBLETEMP = CAST(@DEDUCTIBLEAMT AS NUMERIC (7,0))
set @DEDUCTIBLE = case @DEDUCTIBLETEMP
when '> 100 and <= 250' then '4'
when '> 500 and <= 750' then '6'
when '> 750 and <= 1000' then '7'
when '> 1000 and <= 2500' then '8'
when '> 2500 and <= 5000' then '9'
when '> 5000 and <= 10000' then 'A'
when '> 10000 and <= 25000' then 'B'
when '> 25000 and <= 50000' then 'C'
when '> 50000 and <= 75000' then 'D'
when '> 75000 and <= 100000' then 'E'
when '> 100000 and <= 200000' then 'F'
when '> 200000 and <= 250000' then 'G'
when '> 250000 and <= 300000' then 'H'
when '> 300000 and <= 400000' then 'I'
when '> 400000 and <= 500000' then 'J'
when '> 500000' then 'k'
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
With just a little bit of SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form. If you have never written code or looked at an SQL statement before, no problem! ... give i…