logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
siobhan  
#1 Posted : Tuesday, June 13, 2017 11:44:59 AM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
Hi Guy

I have a NUmber of Dates in the Drop Data Elements section of my report.

In the Data Options section on the right I am

Aggregating with the 'MAX' function
Showing Totals 'for Columns'
Total Aggregate is 'Count'


I have a table like the below with

THIS IS WHAT I AM GETTING :

Type || Date Started || Date Complete

1 || 21/01/2017 || 23/01/2017
2 || 21/01/2017 ||
3 || 21/01/2017 || 23/01/2017
4 || 21/01/2017 || 23/01/2017
5 || 21/01/2017 ||
6 || 21/01/2017 || 23/01/2017
7 || 21/01/2017 ||

Totals 7 || 7

THIS IS WHAT I WANT :

Type || Date Started || Date Complete

1 || 21/01/2017 || 23/01/2017
2 || 21/01/2017 ||
3 || 21/01/2017 || 23/01/2017
4 || 21/01/2017 || 23/01/2017
5 || 21/01/2017 ||
6 || 21/01/2017 || 23/01/2017
7 || 21/01/2017 ||

Totals 7 || 4

I only want to count the results on that column if the Date is Not NUll.

Can you give me some advise on how to do this

Thanks,
Siobhan

epf  
#2 Posted : Wednesday, June 14, 2017 10:10:00 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Looks like the Count aggregate counts also the NULL values.
It is listed as bug 85 and will be fixed in the next release.

You may fix the calculation in your report itself by using either the Cell Script of your element or the Final Script of the model, but this requires to write some C#...

Here is a clue for the Cell Script:
Code:
		if (cell.IsTotal && !cell.IsTitle) {
			int cnt = 0;
			foreach (var line in cell.ContextTable.Lines) {
				var cell2 = line[line.Length-1];
				if (!cell2.IsTitle && !cell2.IsTotal && cell2.Value != DBNull.Value) {
					cnt++;
				}
			}
			cell.FinalValue = cnt.ToString();
		}

siobhan  
#3 Posted : Wednesday, June 14, 2017 12:21:07 PM(UTC)
siobhan

Rank: Member

Groups: Registered
Joined: 6/5/2014(UTC)
Posts: 23
Ireland
Location: Dublin

Thanks: 1 times
Hi epf

Thank You,

I was afraid you were going to say something like that!

I don't think it can be a cell CSS as it is the 'Total' for the Column that I want to update rather than the Cell itself. We have no visibility into the Header Cell.

If I put it in the final CSS for the model where do I put it. At the View HTML Model level there is CSS but this is display options.

Sorry its been a while since I changed these reports.

Thanks
Siobhan


epf  
#4 Posted : Wednesday, June 14, 2017 3:02:01 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
No, I am referring to Cell Script (not CSS):
In your model, select your Data Element, in the properties Advanced, you can set a Cell Script..where you can do what you want as you can change the Cells in the result table.
Users browsing this topic
Guest (4)
Similar Topics
How to change display sort Drop Row & Drop Data Elements (Reports)
by nimainship 3/30/2022 1:42:57 AM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.