Thank you a lot, this solution worked perfectly in KPI object and in a table,
but then I tried to put a formula into a chart, and it stopped working
replace(replace(INTERVAL(AVG("timestamp1"-"timestamp2"), 'D@ hh#'), '@', ' days'), '#', ' hours')
My suggestion is that after two replaces output is viewed as a string and not a number and QS refuses to display that in a chart. I'd really appreciate you could suggest any workarounds.
(The only solution I've come so far is to get rid of replaces and not to use words with H or D in the format expression )