Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
In a table I have values calculated per dimension. I need to repeat the values in the table where the year is always 2018 but differs on country, fueltype.
How can this be done?
Thank you!
I solved it already...
(SUM(AVGPERF * NUMUNITS) / SUM(NUMUNITS))
/
(sum({<SALESYEAR = {"2018"}>}total <COUNTRYCODE, FUELTYPE> AVGPERF * NUMUNITS) / sum({<SALESYEAR = {"2018"}>}total <COUNTRYCODE, FUELTYPE> NUMUNITS))
I solved it already...
(SUM(AVGPERF * NUMUNITS) / SUM(NUMUNITS))
/
(sum({<SALESYEAR = {"2018"}>}total <COUNTRYCODE, FUELTYPE> AVGPERF * NUMUNITS) / sum({<SALESYEAR = {"2018"}>}total <COUNTRYCODE, FUELTYPE> NUMUNITS))
Is this what you wanted ?
test:
load*Inline
[
Country, fuel, year, Realized
XX, Diesel, 2017, 10
XX, Diesel, 2018, 20
XX, Diesel, 2019, 30
XX, Diesel, 2020, 40
XX, Diesel, 2021, 50
XX, Electric, 2017, 10
XX, Electric, 2018, 25
XX, Electric, 2019, 30
XX, Electric, 2020, 40
XX, Electric, 2021, 50
];
left join (test)
final:
load
sum(Realized) as Desired_Output,
Country,
fuel
Resident test2 where year='2018' Group by Country, fuel;
Regards,
Aditya
Hi, no, it was in the table itself but I already figured it out, see above.