Expression to create SSRS column dynamically - ssrs-2008

I need an expression to take an existing column and recreate this column over and over before another column/s where the column name contains either "Monday" or the date of the column falls on Monday.
The reason I need this expression is to repeat a header column in a pivoted report that is pivoting start/enddate parameter. So if a user selects to run the report for this month, they should get 31 columns (for each date/day) and header repeating before every Monday.

Make sure your dataset contains all the dates in your date range. If not create a date table and cross join to it. Don't pivot the results, let SSRS do that bit. Once your dataset has all the dates, you can use a matrix in your report and drop the date colum into the column group. This will give you one column for each date in your dataset. I'm not at my PC at the moment but if you need any more help, show an example of your dataset and I'll put together a quick sample report.

Related

Fill a column with a date that satisfies an id statement in Sap Phoenix Webi

I am trying to fill in the date needed column with the date that has 1 in Match comment and Rank columns. More specifically from all the comments I only need the ones that satisfy a pattern and then I ranked those based on activity date. I need to keep the date that satisfies the last two requirements and fill the DateNeeded column with this date no matter the content of the row.
Ex. Table
Code / activity.date / rank / matchComFlag / DateNeeded
Jfkffj 03/8/22 2 1 10/8/22
Jdiffi 10/8/22 1 1 10/8/22
So i created a variable that has the activity date formated where both flags are one but this only fills the row that applys and the others are blank.
How can i fill the whole DateNeeded column with the date I need?
Thank you in advance!

How to implement a conditional fomula in Crystal Report

I have a table named tblRecovery with 4 column. ID, LStatus, Amount and RecoveredBy I created a formula to sum Amount Column where LStatus Column value is "WCL". I use following code.
It sum all value of Amount column without condition. I want to sum amount column if Lstatus Column value is "WCL". How can I do that?
if {tblRecovery.LStatus}='WCL' then sum({tblRecovery.Amount})
Crystal Reports formulas work on a per-record basis.
Your current formula shows the sum of tblRecovery.Amount on every single row where LStatus='WCL'.
To get the desired result, create a formula-field with following formula and the create a sum of it:
if {tblRecovery.LStatus}='WCL' then
{tblRecovery.Amount}
else
0

Power BI convert eight digit yyyymmdd to date using DAX

I'm trying to convert eight digit yyyymmdd to date format with DAX function.
column = DATE(LEFT(TABLE[COLUMN],4),MID(TABLE[COLUMN],5,2),RIGHT(TABLE[COLUMN],2))
However, I've got an error because of the original column has some records with "00000000", so how can I make a default value with IF statement or are there any better solution?
Best regards
What I typically do is just make 2 distinct Power Query steps and this is handled automatically.
just make the yyyymmdd column a text column
make the text column from step 1 a date column (when prompted, be sure to select 'Add New Step')
replace errors with null
That's it. You can even Ctrl-Click to select multiple columns and combine them into the 1,2, and 3 steps with multiple columns.
Please check out "ferror" function IFERROR(value, value_if_error) for more information please visit Microsoft MSDN with link below
https://msdn.microsoft.com/en-us/library/ee634765.aspx
column = IFERROR( DATE(LEFT(TABLE[COLUMN],4),MID(TABLE[COLUMN],5,2),RIGHT(TABLE[COLUMN],2)), DATE(yyyy,mm,dd))

Tableau - YTD, MTD as columns in text table

I'm trying to find a way to create a table like the one above, but instead of having columns of months I would like to have columns of MTD, QTD, YTD for all selected measure values. I created calculated fields on the [Date] field but when I try to use that it still splits the data in to separate columns of months and quarters... I'm using two data sources and they are linked on the [Date] field. If I try to put two of my calculated fields in the columns bar it just combines them like 'MTD/YTD'. How can I get them to display as separate columns?
I know this is strange because there will be overlapping data (everything in the MTD will also be in the QTD and the YTD).
I found a way to do this. I created a calculated field on the date field and assigned 'MTD' to all records from the last month. Then I assigned 'QTD' to all records from the start of the quarter to the day before the start date of the 'MTD' records. Then I assigned 'YTD' to all records from the start of the year to the day before the start of the 'QTD' records. (this way there are no overlapping records).
After that I just did a quick table calc to make each of them a 'running total' table (across).
I created parameters for the dates so the can easily be updated.

Jasper iReport Designer, weekly average

I am working with iReport Designer and want to ask how can I calculate an average sum of a column based on a date?
I am working on a report which has a database containing a table two columns: 1st is "sample_time" which has DATE values and the second is a "watt" which has an int value.
What I want to do is take the "watt" column and show it as average on the report (which I can do), and then show the same column "watt", but from averages based on the dates from the other "sample_time" column.
Lets say I have the dates from 2008-01-01 to 2008-01-20 and I want to do a weekly average, lets say from 01-01 to 01-07, how can I do that?
Well, i think this can get easily achieved using JasperReports Groups. You can create a group based on you sample_time column, and calculate the average for each group (which means, for each date, its just like doing a group by on a SQL query). Here there are two quick tutorials:
JasperReports Groups || The Groups