I've got a report with a ColumnA that needs to be hidden if to specific values for parameters are met.
Join(Parameters!vExclude.Value,",").Contains(0)=True
and
Parameters!vType.Value = 1
I've tried
= Join(Parameters!vExclude.Value,",").Contains(0)=True and Parameters!vType.Value = 1
= iif(Join(Parameters!vExclude.Value,",").Contains(0)=True and Parameters!vType.Value = 1, true, false)
and it doesn't produce an error, yet one condition is always ignored.
Any suggestions?
Related
I have a table which should hide the rows based on the below conditions -
Parameter value = Active, show rows with Active status
Parameter value = Matured, show rows with Matured status
Parameter value = Active and Matured, show all the records.
I have implemented the below for now -
=iif(parameter!activeormatured.value="Active",
TRIM(LOOKUP(Fields.ProductID.Value,Fields.ProductID.Value, Fields.ProductActiveflag.value, "Datasetname")) = "Active",
iif(parameter!activeormatured.value = "Matured",
TRIM(LOOKUP(Fields.ProductID.Value, Fields.ProductID.Value, Fields.ProductActiveflag.value, "Datasetname")) = "Matured",
False)
)
)
The above expression works only for the scenario Parameter value= Active and Matured.
Array.IndexOf can be used with multi-value paramters to check the selected parameters for a given value.
This should return a TRUE value when the Lookup matches a value in the Parameter.
=Array.IndexOf(Parameters!activeormatured.Value,
TRIM(LOOKUP(Fields.ProductID.Value, Fields.ProductID.Value, Fields.ProductActiveflag.value, "Datasetname"))
) > -1
If it's not a multi-value parameter but a single value with both values, you can use the InStr function which returns the location of a string in another string. If it doesn't find the string, it returns zero.
=InStr(Parameters!activeormatured.Value,
TRIM(LOOKUP(Fields.ProductID.Value, Fields.ProductID.Value, Fields.ProductActiveflag.value, "Datasetname"))
) > 0
The data is as shown below(Source description and total shares) are the two columns
Source 494,482,729,319.98998
Initial
Filtered
Final 494,482,729,319.98998
My expression throws an #Error in output of the report(preview section)
=SUM( Fields!total_shares.Value *
SWITCH(Fields!Source_Description.Value = "Initial" OR Fields!Source_Description.Value = "Inserted", 1,
Fields!Source_Description.Value = "Filtered" OR Fields!Source_Description.Value = "Deleted" OR Fields!Source_Description.Value = "Final", -1,
True,0
)
)
Can you please help me where am I going wrong?
There must be a way in SSRS to have multiple conditionals for separate data filters? I have an input report level filter #reportparameter, and data item "Checknum" I need to do something resembling the following:
if #reportparameter = "C" and Left(Fields!Checknum,2) = "NC", filter
otherwise
if #reportparameter = "E" and Left(Fields!Checknum,2) = "VR", then filter
two separate conditionals, both compound statements.
What does the SSRS Dataset look like, as far as syntax?
If you want this as part of the query, you could add it to the WHERE clause:
WHERE (#reportparameter = 'C' and Left(Fields!Checknum,2) = 'NC')
OR (#reportparameter = 'E' and Left(Fields!Checknum,2) = 'VR')
But if you want to do it in the dataset filter, your filter Expression would be like
=IIF((Parameters!reportparameter.Value= "C" AND LEFT(Fields!Checknum.Value, 2) = "NC")
OR (Parameters!reportparameter.Value= "E" AND LEFT(Fields!Checknum.Value, 2) = "VR")
, 1, 0)
The type would be Integer and the Value would be 1.
I have a table with a few thousand entries. And My purpose is to select all entries from all versions that correspond to a given one. And the resulted entries must correspond exactly to the given entry.
But somehow, the SQL query does not work. The original project uses Access 2007. But I have tried also in MySQL and no success
I put here the sql query, but I also made a SQL fiddle:
SELECT
idvalue,
idtag,
iddevice,
idversion,
idtext,
description,
idaccess,
defaultvalue,
minimumvalue,
acceptedvalue,
maximumvalue,
outofrangevalue,
iddatatypepn,
iddatatypeopc,
size,
idresolution,
idunit,
idaccuracy,
enumerationvalues,
comments,
remanentvolatile,
storedatpn,
storedatmain,
`generated`,
edittime
FROM
SomeValues
WHERE
idtag = 2 AND iddevice = 1
AND idtext = 433
AND description = 'Input voltage (AC)'
AND idaccess = 12
AND defaultvalue IS NULL
AND minimumvalue =0
AND acceptedvalue = 5300
AND maximumvalue = 10050
AND outofrangevalue = 11000
AND iddatatypepn = 2
AND iddatatypeopc = 19
AND size = 2
AND idresolution = 2
AND idunit = 1
AND idaccuracy = 2
AND enumerationvalues IS NULL
AND comments IS NULL
AND remanentvolatile IS NULL
AND storedatpn = FALSE
AND storedatmain = FALSE
AND `generated` = TRUE
Fiddle: here
Can you please explain what is wrong with the sql query?
The result should be those 3 entries from the fiddle table.
And yes, I must use all the conditions from the "Where" clause, since the entries can match 90% but also have small differences
You have problem in line:
AND description = 'Input voltage (AC)'
change it to:
AND description = '"Input voltage (AC)"'
and everything will works.
Problem lies in the fact that you searched for text Input voltage (AC) instead of "Input voltage (AC)" (how is stated in column description).
I am facing following scenario :
I have two values A and B and I need to Hide and show it based on ssrs expression.
My Conditions :
If A = 1 and B = 1 show row
If A = 1 and B = 0 Show row
If A = 0 and B = 1 Show row
If A = 0 and B = 0 Hide Row
(I have tried using AND, OR, XOR, AndAlso, OrElse but it is not working.)
(Problem arises because SSRS shows when output is false and hides when output is true)
Select the table detail row (or group row depending your table) and in the Visibility set the hidden expression like below
= ( Fields!A.Value = 0 AND Fields!B.Value = 0)