Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Formula query

Hi all, 

Formula below is not giving any results when there is no selection made.
I need: when no selection is made, the result to display an average.
Can anyone help?

sum([1ENV08]+[ENV22 ]) /
([1HS11 ]+[1HS06])

As always, thanks a million.

Jose

Labels (1)
5 Replies
Taoufiq_Zarra

@JoseGarcia  can you share a sample data and the expected output ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
JoseGarcia
Creator III
Creator III
Author

here's a sample table:

the values should return three decimals: 0.0096 (example)

SiteEnergy consumption - MWh of natural gasEnergy consumption - MWh of electricityE+C hours consolidated
Golders Green309.8367.1739,130.50
Manchester TCC133.0021578,777.67
Wembley TCC103.0014125,322.50
Morden97.1352.7218,260.00
Glasgow TCC50.0016724,324.40
Widnes TTC19.4671.729,392.40
Oxley TCC17.70107.233,538.33
Liverpool TCC7.9053.711,955.00
Chester TCC6.2464.818,338.67
JoseGarcia
Creator III
Creator III
Author

this a a month data sample

 

Taoufiq_Zarra

@JoseGarcia  and the forumula ? the fields [1ENV08], [ENV22] ,... ?

sum([1ENV08]+[ENV22 ]) /
([1HS11 ]+[1HS06])

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
JoseGarcia
Creator III
Creator III
Author

Taoufiq, 

Avg
(Sum([1ENV08 Energy consumption - MWh of natural gas]+[ENV22 Energy consumption - MWh of electricity])/
([1HS11 Contractor hours worked]+[1HS06 Employee hours worked]))