
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aggr & avg
Hi there!
Need your help so much with issue: I need to calculate Average by Dates with formula: 1-fact/fact2.
I've managed with Text Object, but I don't know what to do with table:
For text object I've used formula:
Num(
Avg(
Aggr(1-Sum(Fact1)/Sum(Fact2),Date)
),
'# ##0,000%')
But it doesn't fit for table (second expression in table).
I tried to add field "Channel" to Aggr expression, but still doesn't work properly (first expression in table).
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here you are
If(Dimensionality() = 0, Avg(Aggr(1-Sum(Fact1)/Sum(Fact2), Date)), Avg(Aggr(1-Sum(Fact1)/Sum(Fact2), Date, Channal)))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try
Num(
Avg( TOTAL
Aggr(1-Sum(Fact1)/Sum(Fact2),Date)
),
'# ##0,000%')
or
Num(
Avg(
Aggr(NODISTINCT (1-Sum(Fact1)/Sum(Fact2)),Date)
),
'# ##0,000%')
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vineeth, thanx for your reply, but it still doesn't fit (same values for C1 and C2).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This one should, I think
Num(
Avg( TOTAL
Aggr(1-Sum(Fact1)/Sum(Fact2),Date)
),
'# ##0,000%')


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try below
Num(
Avg( TOTAL
Aggr(1-Sum(Fact1)/Sum(Fact2),Date)
),
'# ##0,000%')
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,Sunny! Nope, still doesn't fit:
Channal | Date | Fact1 | Fact2 |
C1 | 01.01.2017 | 10 | 100 |
C1 | 02.01.2017 | 8 | 70 |
C2 | 01.01.2017 | 3 | 10 |
C2 | 02.01.2017 | 5 | 9 |

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nope, doesn't work (see previous answer, please).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why add <Channel>?
This worked for me
Avg(TOTAL Aggr(1-Sum(Fact1)/Sum(Fact2), Date))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess what is the expected output here?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunny,
I expect to see that table:
Channal | Value |
Total | 85,863% |
C1 | 88,182% |
C2 | 83,544% |

- « Previous Replies
-
- 1
- 2
- Next Replies »