Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a qvd with a field that contains a timestamp in numeric notation (for example 43251,501435185)
When loading this qvd I find the highest value with : Set maxvalue=max(fieldname).
I use this variable in an expression like :
Sum( {<fieldname={"=$(maxvalue)"}>} counted_employees)
The result is the sum of all values and not only of the maxvalue.
When I use the expression :
Sum( {<fieldname={'43251,501435185'}>} counted_employees) I get a correct result.
When I use the expression : Sum( {<fieldname={$(maxvalue)}>} counted_employees) i get an error
Error: Error in set modifier ad hoc element list:
',' or ')' expected
The value 43251,501435185 was found with the expression =$(maxvalue) in a textbox
I don't no what is wrong with my set analysis expression
Your first attempt didn't work because your variable returned a value which is not 0 and therefore it is automatically TRUE and this for all records. By your second trial the return-value contained a comma which is here not treated as a decimal-delimiter else as a parameter-delimiter within the set analysis. But the following should be working:
Sum( {<fieldname={'$(maxvalue)'}>} counted_employees)
because the single-quotes convert it into a string-value like in your manually approach from above.
- Marcus
When I use single_quotes the result = 0
My settings are :
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
Can you try this
Sum({<fieldname={"$(=$(maxvalue))"}>} counted_employees)
Then try: Sum( {<fieldname={'$(=maxvalue)'}>} counted_employees)