New to Dundas and .NET/C# coding so struggling to even get my syntax right
I’m attempting to create a calculated element in a data cube to get the interval in hours between two datetimes.
What I’ve tried:
DateTime date1 = $Date1$;
DateTime date2 = $Date2$;
TimeSpan interval = (date1 - date2);
return interval.TotalHours;
The thing is, if I filter my input data and limit it to one row, this code works.
However, if I unfilter it and include all data, it will not run and I get the “Data retrieval failed, as it was not possible to generate a valid query for the specified metric set” error.
Can anyone please help me figure out how to return this interval of hours between two datetimes for each record in my datacube?