AnsweredAssumed Answered

Month to Day from Lookup Table

Question asked by YMax on Feb 1, 2018
Latest reply on Feb 14, 2018 by aseck

Hello,

I try to create Analysis for Month to Day calculation. I have SQL Database with series data, where operator inserts one value per day. The important note: Operator inserts value one day later than time stamp of value. This means that on the 1st of Jan I should show the value 0, on Jan 2, I show the value recorded on the 1st of Jan, the 3rd Jan show the SUM of the values recorded on the 1st and 2nd of Jan. And so on.

I created the Attribute in the AF Element that return all data is stored in this table. In the picture below showed data for week:

1.png

Also, I created Analysis for this purpose with two variables. Variable1 just refers to Attribute mentioned above. Code in the second variable is below:

     if Day('*')=1 then 0 else if Day('*')=2 then TagVal(Variable1,bod('y')) else TagTot(Variable1,bom('*'),bod('*'))

 

If we compare two tables: 1 - The Data Source and the SUMs calculated in Excel, and 2 - the Result of the Analysis, it is seen that the function TagTotal returns a different result:

2.png

Is there a function that will take the sum of the values directly written into the database? I didn't find it.

 

Thanks a lot.

 

Regards,

Max.

Outcomes