SSRS - How to Sum values on a LookUpSet expression - ssrs-2008

Hi I have a column that uses a lookupset expression =Join(LookupSet(Fields!ReportUNC.Value, Fields!ReportUNC.Value, Format(Fields!cntSelfService.Value, "###,#######0"), "ExecutionCount")).I'm getting an incorrect parameter when I sum that expression to =Join(Sum(LookupSet(Fields!ReportUNC.Value, Fields!ReportUNC.Value, Format(Fields!cntSelfService.Value, "###,#######0")), "ExecutionCount")). The column to sum is cntSelfService. Please advise.

You have a few different issues with your expression.
When you use the FORMAT function, the result is a string, not a
number.
JOIN is used to concatenate strings from a table into a
single string which wouldn't help your issue.
SUM will not work with a LookupSet
Unfortunately, there's not a built-in way to sum values from a LookupSet.
Luckily, users have had this issue for a while and someone created a function in Visual BASIC SumLookUp that will add the values from a lookupset. You add the code in the Report Properties --> Code tab.
Your expression would be:
=CODE.SumLookup(LookupSet(Fields!ReportUNC.Value, Fields!ReportUNC.Value, Fields!cntSelfService.Value, "ExecutionCount"))
See the code in: Need help in calculation using two Datasets using Expression SSRS

Related

Smartsheet function is UNPARSEABLE

On the Sheet Summary I'm trying to write a function that will track Past Due tasks below is the format :
=COUNTIF([Is Past Due?]:[Is Past Due?], "Yes")
The formula doesn't work as it says "UNPARSEABLE". Below is the Past Due column name
The UNPARSEABLE error in Smartsheet happens when, the formula has a problem which prevents it from being parsed and interpreted.
Example:
-misspelling
-incomplete operators
-using the wrong case for a column name
-using single quotes instead of double quotes
Maybe, you have to review the syntax of the function COUNTIF, and make sure to use acceptable operators, follow this link for more information about the function
---Syntax---
COUNTIF( range,criterion )
range
— The group of cells to count.
criterion
— The value that determines which cells in the range will be counted.
I hope this information can be useful for you.

Using the toInteger function with locale and format parameters

I've got a dataflow with a csv file as source. The column NewPositive is a string and it contains numbers formatted in European style with a dot as thousand seperator e.g 1.019 meaning 1019
If I use the function toInteger to convert my NewPositive column to an int via toInteger(NewPositive,'#.###','de'), I only get the thousand cipher e.g 1 for 1.019 and not the rest. Why? For testing I tried creating a constant column: toInteger('1.019','#.###','de') and it gives 1019 as expected. So why does the function not work for my column? The column is trimmed and if I compare the first value with equality function: equals('1.019',NewPositive) returns true.
Please note: I know it's very easy to create a workaround by toInteger(replace(NewPositive,'.','')), but I want to learn how to use the toInteger function with the locale and format parameters.
Here is sample data:
Dato;NewPositive
2021-08-20;1.234
2021-08-21;1.789
I was able to repro this and probably looks to be a bug to me . I have reported this to the ADF team , will let you know once I hear back from them . You already have a work around please go ahead that to unblock yourself .

qPython QProjection Issues instead of queried data

I tried writing a Q Code which will allow me to pass parameters however I am getting a results as Qprojection. I tried using
qpython.sync() is returning a QProjection instead of the queried data
but solution isn't working(new to Q/kdb world)
Any ideas on what exactly I should change?
q.sync(
'''{[x;y;z]select from quotestackevent where date within(x;y),sym=z}''',
[np.datetime64('2018-04-14','D'), #start date
np.datetime64('2018-04-14','D'), #end date
np.string_('GBPUSD')])
In Q/KDB the functional format is {......}[x;y;z], with x y z being the arguments. If you have left a blank argument then the function becomes a projection.
qpython allows you to pass python arguments to a q function, with the format being q.sync('{......}',x,y,z).
In your example the square brackets is causing the inputs to be passed as a single array to the function, resulting in a projection. This can be fixed by removing the square bracket.
q.sync('{[x;y;z]select from quotestackevent where date within(x;y),sym=z}', np.datetime64('2018-04-14','D'), np.datetime64('2018-04-14','D'), np.string_('GBPUSD'))
Hope this helps!

Crystal Formula to exclude if value does not contain a certain format

I'm trying to exclude any value from a certain field (table.value) that does not match this format AA#####A. Example if they entered APT12345T, or PT12345PT and No Value then I want to exclude it from the report. It needs to match example AP12345P. What selection formula can I use to accomplish this.
Any help is greatly appreciated
Thanks in advance.
try reading Crystal's help topics on the mid() and isnumeric() functions.
here's an example from the help file:
Examples The following example is applicable to both Basic and Crystal
syntax:
Mid("abcdef", 3, 2)
Returns "cd".
so, in your case, you want to strip your value into three pieces,
mid(table.value,1,2)
mid(table.value,3,5)
mid(table.value,8,1)
and build up a three-part boolean variable where:
the first piece is not numeric(), or between 'AA' and 'ZZ', or however
else you want to test for letters,
the second part isnumeric(), and
the third part passes the same test as the first part.
where are you getting stuck?
something like this:
not isnumeric(mid({table.field},1,2)) and
isnumeric(mid({table.field},3,5) and
not isnumeric(mid({table.field},8,1))

Excel SUM current column (via Excel::Template)

I'm using Excel::Template to generate a series of Excel files via perl. However, I need to do a SUM function on the current Column. I know I can do
=SUM(3:15)
but that gives the sum of ALL columns in rows 3-15. Is there an easier way to do what I'm trying to do?
=sum(indirect(concatenate(address(<row_start>,column()),":")&address(<row_end>,column())))
gives me exactly what I need. Not exactly sure how it works, but found on MrExcel.com
For column C,
=SUM(C3:C15)
Since =SUM(...) is just a string, you may have to parametrize the column if you don't know it before runtime. For instance
$str = "=SUM(" . col_char . "3:" . col_char . "15)";