3 Replies Latest reply on Mar 15, 2017 1:09 AM by Norbert Maijoor

# Cost Calculation for Day time and Night Time

Hi everyone,

I have two parameters: Daytime and Night Time Cost ( €) . This parameters change according to Day or Night Period.

I have two parameters Inital Time and Final Time ( Datetype: DateTime).

I also have two calculated fields: Daytime Cost = ( Watts * parameter.daytime) and Night Time Cost (watts * parameter.night time).

Right now on my dashboard only Daytime Parameter is working for all periods of time.

But what I need is when user select between 09 AM - 21 PM  DayTime Cost is showed and when user select between 21 PM - 09 AM Night Time Cost is showed.

Can anyone help me on this ?

Mafalda

• ###### 1. Re: Cost Calculation for Day time and Night Time

Hi Mafalda,

Find my approach as reference below and stored in attached workbook version 9.3 located in the original thread

1. Time (Hours)

Calc:

if [Time (Hours)]>=21 and [Time (Hours)]<=24 or [Time (Hours)]>=0 and [Time (Hours)]<=9 then  [Value]*[Night Time Cost (€)]

ELSEIF  [Time (Hours)]<21 and [Time (Hours)]>9 then  [Value]*[DayTime Cost (€)] END

Regards,

Norbert

• ###### 2. Re: Cost Calculation for Day time and Night Time

Thanks a lot Norbert!

Great Job ! It´s working

Regards,

Mafalda

• ###### 3. Re: Cost Calculation for Day time and Night Time

Goodmorning Mafalda,

You are welcome.