string - SSRS choosing dynamic Columns -
For my report, I have to choose which columns are dynamically accessing the database < pre> I need: to be more precice: column in the database, thus named for the current year and quarter Report to choose, so I am using and results I need string exactly ( Is there a solution for this problem? You can not create such an area - you are actually creating a string what you want to do The field name is created to look it up in the looks like this: So you can use your very large expression: You can also simplify that expression. You must do this for: then your expression below another potentially simple way by using a dynamic SQL string. coherent field names for example, if your SQL looked like this : From MyTable You can change that leads to a SQL statement is a string expression. Right-click the dataset, select the dataset property and click on the Expression Editor Now you are dynamically making the field name in SQL query and it is and FCST_Sales_2014_Q4_with_SF FCST_Sales_2015_Q1_with_SF FCST_Sales_2015_Q2_with_SF FCST_Sales_2015_Q3_with_SF
now () which I need to composite with expression For example:
= year (now ())
= switch (month ( Now ()) = 1, 1, month (now ()) = 2, 1, month (now ()) = 3, 1, month (now ()) = 4, 2, month (now ()) = 5 , 2, month (now ()) = 6, 2, month (now ()) = 7, 3, month (now ()) = 8, 3, month (now ()) = 9, 3, month (now ()) = 10, 4, month (now ()) = 11, 4, month (now ()) = 12, 4)
2014 And
4 what exactly i want If I am using the following:
= ( "field! Fsissisass_s +" + Sisarar (Year (Now ()) + "_kyu" + CSR (switch (Month (Now () ) = 1, 1, month (now ()) = 2,1, month (now ()) = 3,1, month (now ()) = 4, 2, month (now ()) = 5,2, Month (now ()) = 6,2, month (now ()) = 7,3, month (now ()) = 8,3, month (now ()) = 9,3, month (now ()) = 10, 4, month (now ()) = 11,4, month (now ()) = 12,4)) + "_with_SF")
FCST_Sales_2014_Q4_with_SF ) But the problem is that I I can not use the
.value operation if I add the
sum () and
.value to the expression then I get the error message , Then there is no member of the
.value string. Expression I used:
= add (("! Fields FCST_Sales_" + CSTR (year (Now ()) + '_Q "+ CSTR (switch (month (now ()) = 1,1, month (now ()) = 2,1, month (now ()) = 3,1, month ( Now ()) = 4,2, month (now ()) = 5,2, month (now ()) = 6,2, month (now ()) = 7,3, month (now ()) = 8 , 3, month (now () ) = 9,3, month (now ()) = 10, 4, month (now ()) = 11,4, month (now ()) = 12,4) + "_with_SF"). Value)
field collection, so instead:
field! FieldName.Value
field ("field name"). Value
= yoga (field ("FCSSASS_s +" + CST (year (now ( ) (+) + "_Q" + CSR (Switch (month (now ()) = 1, 1, month (now ()) = 2, 1, month (now ()) = 3, 1, month (now ( ) = 4,2, month (now ()) = 5, 2, month (now ()) = 6, 2, month (now ()) = 7, 3, month (now ()) = 8, 3 , Month (now ()) = 9, 3, month (now ()) = 10, 4, month (now ()) = 11, 4, month (now ()) = 12, 4)) + "_with_SF" ). Value)
(month (today) + 2) \ 3
= add (fields ("FCST_Sales_" + CSTR (year (today)) + '_Q "+ CSTR ((month (today) + 2) \ 3) +' _with_SF"). Value) alternative method the dynamically field using SQL to create name
Defense Select FCST_Sales_2014_Q4_with_SF
fx button next to the query. Now we can create SQL statements from a string, such as
= "SELECT FCST_Sales_" + Sisarar (Year (Today)) + "_Q" + CSR ((Month (today) + 2) \ 3) + "_with_SF AS FCST_Sales" and "From MyTable"
FCST_Sales In the dataset so that you can easily use the known field value in your report, which makes your calculations very easy:
= Field! FCST_Sales.Value
= SUM (field! FCST_Sales.Value)
Comments
Post a Comment