Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Calculate for current month

Hello All, 

I have a static table with percents for each month i need to calculate the miles for current month percentage 

static table 

 

TypeJulAugSepOctNovDecJanFebMarAprMayJun
TP9.6%18.9%27.3%35.9%42.5%49.0%57.5%65.4%74.6%83.0%91.5%100.0%
TDPS8.1%16.5%23.5%30.2%35.5%42.6%56.5%66.5%76.3%84.9%92.9%100.0%
TDT8.3%16.5%23.9%30.9%36.3%43.4%57.0%67.0%76.6%85.1%92.8%100.0%
TD19.1%18.2%26.9%35.7%43.4%51.6%60.5%68.1%76.6%84.2%92.2%100.0%
G8.7%16.8%24.5%33.3%39.3%47.1%57.7%64.9%74.3%83.9%92.4%100.0%
WL6.4%13.5%19.1%25.1%29.6%37.7%55.9%69.7%81.0%88.7%94.4%100.0%

 

and the table with values that need to calculated 

 

TypeMileage  Time%  Time Days
TP11,000000
TDPS7,50056040%118
TDT9,50067040%133
TD113,000

0

00
TUB10,000000
TCC1,800000
TAB12,000000
G300000

 

now for Type TDPS we have to calculate mileage for this current month % for static table 

for TDPS mileage is 7,500 and current month is may 

so i have to show the value 6963.95 which is (92.9%*7,500)

 

 

1 Reply

  • Unpivot the first table, convert the months to proper date fields (including day and year), then join the tables via the Type column (for example) to compute your measure.