SSRS date drill through issue - sql

I have a matrix report called Store Sales which is made up of:
STORES in the row group
DATES in the column group
Sum of SALES in the values group
The DATES column is formatted using the following expression:
=format(Fields!DATES.Value, "MMM yyyy").
The matrix report also has 2 parameters #Start and #End. This all works great but I then added a linked report (Sales Store Details) so that the user can click on the SALES value for any purchase by month and store. The linked child report (Sales Store Details) uses the #Start and #End parameters from the original report (plus an additional #Store parameter) but this is where I run into problems. Rather than bringing me the purchase details for a particular store and month it brings me back everything from the time period selected from the original date parameters. So say I originally selected 2015-01-01 to 2015-06-30 with the #Start and #End parameters from the Store Sales report. When I then select on my FEB 15 value in my matrix report the drill down linked report doesnt just give me Feb 15 data but all the other months data too ie Jan-Jun 15. I understand that the original report parameters specified the Jan-Jun 15 date period but surely when I select on the Feb value in the matrix report that's what my linked report should drill down too right?
Any help would be really appreciated.

It sounds like you're passing the original #Start and #End parameters from the parent report. If so then you're passing the original date filtering parameters so it shouldn't be surprising that the date filtering on the child report is the same.
If you want to limit the child report's date filtering to only the month of the row being clicked you'll need to pass through the date value for that row instead of the original parameters. I'm not sure how your data set is structured but I assume there is some date column you use to determine the appropriate filtering to use.

Related

How to show data for current (using dataset1) and last quarter(using dataset 2) in SSRS?

I need to show total number of cases open during current quarter(selected from parameter) and open cases in last quarter. I'm using different datasets with different conditions for my report. One dataset query should show cases based on the Quarter selected, for example Jan-Mar which is working fine. Another dataset query should show me the cases that were received by end of last quarter. For example, when I select Jan-Mar, it should display cases received by end of last quarter which is Dec 31st, 2021. How can I accomplish this? I could use 'on-or-before' operator in my fetchxml but Quarter is not a field in the database, it's a calculated field in SSRS.

Comparision Calculator in DataStudio

Is it possible to show comparison metric for Google Data Studio Score cards. I want to show mom/yoy change.
I have parsed this "text" column using PARSE_DATE('%B/%Y', column name) and it now shows me unit purchased at the start of each month, I want to show the comparison to previous month but it shows "no data".
How do I put the comparison indicator?
According to your requirement the ‘No data’ error is due to the following possibilities:
1- The one Possibility is with the wrong date column which you might have given in your ‘date range dimension’, You have to provide the Date column which should be in date format , not the one which is in “text” format.
2- The other Possibility is Incorrect comparison date range. When you are providing the data range you have to provide the full set of data for the time Period else it will throw you the error “No data”.
For your second query - Yes you can do the comparison metric in the Scorecard for Month over Month (MOM) as well as Year over Year (YOY)
Steps:
1- Create a scorecard for year1 with filter to choose that particular year only (say for example filter to choose year 2020)
2- Similarly create another scorecard for year2 with filter (say for example filter to select only year 2021)
3-Blend both the scorecards.
4-Customize the ratio.
you can refer to this public documentations also:
No data Error
Date Ranges in Data Studio
scorecards
Blending

Limiting data on monthly basis from start date to system date dynamically in Tibco spotfire

I've tried limiting data on monthly basis in spotfire and it's working fine.
Now I'm trying to do like getting the records from the current date to month start date.
For suppose if the current date is Sept 21, then i should get the records from Sept 21 to Sept-01(dynamically).
I have a property control to input the number of months.
The easiest way to do this is with Month and Year. For example, in your visualization:
Right Click > Properties > Data > Limit Data Using Expressions (Edit)
Then, use this expression:
Month([TheDate]) = Month(DateTimeNow()) and Year([TheDate]) = Year(DateTimeNow())
This will limit the data to only those rows with the current Year/Month combination in your data column. Just replace [TheDate] with whatever your date column name is.
In other places, you can wrap this in an IF statement if you'd like. It's redundant in this case, but sometimes helps with readability.
IF(Month([TheDate]) = Month(DateTimeNow()) and Year([TheDate]) = Year(DateTimeNow()),TRUE,FALSE)
#san - Adding to #scsimon answer. If you would like to precisely limit values between 1st of the current month to current date, you could add the below expression to 'Limit data using expression' section.
[Date]>=date(1&'-'&Month(DateTimeNow())&'-'&year(DateTimeNow())) and [Date]<=DateTimeNow()

Creating a calculated column (not aggregate) that changes value based on context SSAS tabular DAX

Data: I have a single row that represents an annual subscription to a product, it has an overall startDate and endDate, there is also third date which is startdate + 1 month called endDateNew. I also have a non-related date table (called table X).
Output I'm looking for: I need a new column called Categorisation that will return 'New' if the date selected in table X is between startDate and endDateNew and 'Existing' if the date is between startDate and endDate.
Problem: The column seems to evaluate immediately without taking in to account the date context from the non-related date table - I kinda expected this to happen in visual studio (where it assumes the context is all records?) but when previewing in Excel it carries through this same value through.
The bit that is working:I have an aggregate (an active subscriber count) that correctly counts the subscription as active over the months selected in Table X.
The SQL equivalent on an individual date:
case
when '2015-10-01' between startDate and endDateNew then 'New'
when '2015-10-01' < endDate then 'Existing'
end as Category
where the value would be calculated for each date in table X
Thanks!
Ross
Calculated columns are only evaluated at model refresh/process time. This is by design. There is no way to make a calculated column change based on run-time changes in filter context from a pivot table.
Ross,
Calculated columns work differently than Excel. Optimally the value is known when the record is first added to the model.
Your example is kinda similar to a slowly changing dimension .
There are several possible solutions. Here are two and a half:
Full process on the last 32 days of data every time you process the subscriptions table (which may be unacceptably inefficient).
OR
Create a new table 'Subscription scd' with the primary key from the subscriptions table and your single calculated column of 'Subscription Age in Days'. Like an outrigger. This table could be reprocessed more efficiently than reprocessing the subscriptions table, so process the subscriptions table as incrementals only and do a full process on this table for the data within the last 32 days instead.
OR
Decide which measures are interesting within the 'new/existing' context and write explicit measures for them using a dynamic filter on the date column in the measures
eg. Define
'Sum of Sales - New Subscriptions',
'Sum of Sales - Existing Subscriptions',
'Distinct Count of New Subscriptions - Last 28 Days', etc

Filter PowerPivot based on multiple Date Criteria

I am trying to apply some Time Intelligence functions in my PowerPivot workbook concerning projects and money received for them. I have three relevant tables; Matters, Payments, and a Date Table.
Each matter has a creationDate, and a closureDate(from a linked table). Likewise, each payment has a date. I have reporting set up decently, but am now trying to use Time intelligence to filter this a bit more clearly.
How can I set a PowerPivot Pivot Table up so that the only Matters which show are those which existed within the period selected. e.g. If I select a slicer for 2014, I don't want to show a matter created in 2015, or one which was closed in 2013. The matter should have been active during the period specified.
Is this possible?
You want to show all the matters EXCEPT those where the CreationDate is after the upper limit of the date range you are looking at or the ClosureDate is before the lower limit of the date range you are looking at.
Assuming you have a data structure like this, where the left-hand table is the Matters and the right-hand one is the Payments:
If you have a calculated field called [Total Payments] that just adds up all the payments in the Payments table, a formula similar to this would work:-
[Payment in Range]:=IF(OR(MIN(Matters[Creation Date])>MAX('Reporting Dates'[Date]),MAX(Matters[Closure Date])<MIN('Reporting Dates'[Date])),BLANK(),[Total Payments])
Here is the result with one month selected in the timeline:
Or with one year selected in the year slicer:
NOTE: in my example, I have used a disconnected date table.
Also, you will see that the Grand Total adds up all the payments because it takes the lowest of all the creation dates and the highest of all the closure dates to determine whether to show a total payment value. If it is important that the Grand Total shows correctly, then an additional measure is required:
[Fixed Totals Payment in Range]:=IF(COUNTROWS(VALUES(Matters[Matter]))=1,[Payment in Range],SUMX(VALUES(Matters[Matter]),[Payment in Range]))
Replace the [Payment in Range] in your pivot table with this new measure and the totals will show correctly, however, this will only work if Matters[Matter] is used as one of the fields in the pivot table.
Use filters & the calculate function.
So, if you're Summing payments, it would look like.....
Payments 2014:= CALCULATE( SUM([Payments]), DateTable[Year]=2014)
The Sum function takes the entirety of payments & the filter function will only capture payments w/in 2014, based on the data connected to your date table.