I made totalizer in Analysis for a period of time 06-06h (24h) but I do not get a good result.
Where I'm wrong?
If Hour('*')<6 then TagTot('Attribute','t-18h','*') else TagTot('Attribute,'t+6h','*')
It sometimes helps to go to the Help and review the functions. Here is help on the TagTot function. You may get wrong results if (1) the UOM is a rate and (2) that rate is not a "per day" rate. See KB01546.
Other than that, can you explain more about what's happening? What is the UOM for the attribute? What results are you receiving versus what results do you think it should have?
I saw a previously deleted message with Bod function, but it was deleted.
I'd love to try it, can you give me an example that was there.
The Bod is not needed. I was correct in that '*' means trigger time for Analytics. I was wrong when I said that 't' always meant today. The correct answer is 't' in Analytics is also in relation to trigger time. Therefore 't' and Bod('*') return the same timestamp.
Let's clarify what you are doing versus what you are intending to do. From just reading the expression, I am guessing that the analysis is Event Triggered. Is this correct? Or do you intend for it to be Periodic?
If you do want it to be Event Triggered, this will produce running totals that are reset at 6 AM.
What is the Default UOM for 'Attribute'?
Are the results even persisted back to a PIPoint?
Here are related threads that may help you:
Does TagTot() in Asset-Based Analytics understand the units?
Totalizing Power using TagTot()
Understanding the TagTot function
Once that gets working for a standard 24 hour day, you then need to consider what happens during a DST transition and the "day" may be 23 or 25 hours.
I made a test totalizer in PI (TIMEWEIGHTED) and when I compare, result from AF totalizer x 24 is exactly the same value.
If Hour('*')<6 then TagTot('Attribute','t-18h','*')*24 else TagTot('Attribute,'t+6h','*')*24
Default UOM: tonne (t)
Retrieving data ...