Business Objects - query with parameter based on a variable - sap

I'm writing a report in Business Objects, and need to select data dating 10 weeks from the current reporting date to the current reporting date.
I have a query element telling me the current reporting date, and I have created a variable holding the date 10 weeks ago.
=RelativeDate([Current Date];-10;WeekPeriod)
I'm now editing the data provider, and add a query filter for the date range. However, I'm not able to select the variable as an object available in the query.
I feel that I'm missing something basic. How can I select my dates based on a database object date and a predefined range of dates?

Document variables cannot be used in the Query Panel. After your query is executed and a report has been generated, you can then filter it by using this variable.

Related

Crystal Reports dynamic group summary

I'm trying to figure out a way to dynamically create a report summary that lists the totals of instances for each account dynamically at the beginning or end of the report. An account will only show up on the report if that account had any instances in the date/time range established by the Start/End date parameter fields, so every account will not always show, hence the dynamic part of the problem. There is surprising sparse information on how to do this from what I've found. Any ideas would be appreciated.
Use Insert, CrossTab...
Select Account as the row and select the value you wish to summarize.
There are many other options if you look into CrossTab features...

Can we show values from two different timelines in one worksheet in Tableau?

My problem statement is described below :
I have a calculated field, say Opportunity. There is pre defined rule from organization, that the target value for current month will be 1/3rd of the value of 2 months back. For example, The target opportunity value for April will be 1/3rd value of February. I need to show the current month's opportunity and the targeted value in the same worksheet. How to achieve this is Tableau?
I am getting the base data from tables in Oracle through a custom sql query, and calculating the opportunity value in Tableau for each row, and then showing the sum for a range of time , say last 6 months.
The best way to do this would be to write the target value in SQL. It'll be easier (no need for data blending / complex calcs) and also more performant as it would be a hardcoded value in your dataset.

QlikView Dynamic Date Comparisons

I’m relatively new to Qlikview and have a dataset that shows metrics by date.
This data spans two years and the requirement is to have a comparison/variance that is dynamic and can handle the date filters on the report.
For example if the user selects 2018 this field should show the current date compared to the previous year date. Similar for Quarters, months, weeks and weekdays.
Ideally it should always show for the previous period. They’ve had this created in Excel but it can’t handle the amount of records and I suggested QlikView as I had created some other Dashboards in it.
I have tried set analysis though I struggle to see how that would fit into one expression.
Any thoughts would be appreciated!
I would say you would need two expressions, one without a set analysis (that would be filtered by your current selection) and one with a set analysis to guarantee that you only get today's value. This would be something like :
Sum($<[Date Field] = {"$(=Date(Today(), 'DD/MM/YYYY'))}>} [Value Field])
Check the date format conversion to see if it matches the date format of your field.

Need Date Calculation MS Access

I need a flexible table that displays dates. By flexible, I mean, if I put in June 15, 1976, it displays as such. But if I put 20, Access calculates that 20 in the same field as today's date - 20 years.
I set the formatting of the date/time field in table: tbl_ageLimit to #, so it displays a serial date rather than a user readable date. This table has one field: ageLimit.
I am trying to develop a query to recognize if the date is not relevant in its current state and then convert it to something relevant and put it in another table that will constantly update.
Right now, I'm just trying to get formula to work on recognizing and converting the date. This is the formula that works splendidly in excel, but doesn't seem to be working in MS Access:
IIF([ageLimit]<=100,Date()-365*[ageLimit],[ageLimit])
It recognizes if the field has a number in it that is less than 100. But it's not doing the math and displaying a new record in the new table. Below is the sql:
SELECT tbl_ageLimit.ageLimit INTO tbl_allAges
FROM tbl_ageLimit
WHERE (((tbl_ageLimit.ageLimit)=IIf([ageLimit]<=100,Date()-365*[ageLimit],[ageLimit])));
Can someone kindly point out to me what I'm doing wrong? Thank you.
As requested, here are snapshots of the problem:
The table that is created is not showing the fifth record. Stumped.
Consider removing the WHERE clause as you do not need to filter records. Since you intend to evaluate the IIF() expression, place in the SELECT clause:
SELECT IIf([ageLimit]<=100, Date()-365*[ageLimit], [ageLimit]) As [age_Limit]
INTO tbl_allAges
FROM tbl_ageLimit

Derived date calculation

I am currently entering data into a SQL Server database using SSIS. The plan is for it to do this each week but the day that it happens may differ depending on when the data will be pushed through.
I use SSIS to grab data from an Excel worksheet and enter each row into the database (about 150 rows per week). The only common denominator is the date between all the rows. I want to add a date to each of the rows on the day that it gets pushed through. Because the push date may differ I can't use the current date I want to use a week from the previous date entered for that row.
But because there are about 150 rows I don't know how to achieve this. It would be nice if I could set this up in SQL Server where every time a new set of rows are entered it adds 7 days from the previous set of rows. But I would also be happy to do this in SSIS.
Does anyone have any clue how to achieve this? Alternatively, I don't mind doing this in C# either.
Here's one way to do what you want:
Create a column for tracking the data entry date in your target table.
Add an Execute SQL Task before the Data Flow Task. This task will retrieve the latest data entry date + 7 days. The query should be something like:
select dateadd(day,7,max(trackdate)) from targettable
Assign the SQL result to a package variable.
Add a Derived Column Transformation between your Source and Destination components in the Data Flow Task. Create a dummy column to hold the tracking date and assign the variable to it.
When you map the Excel to table in a Data Flow task, map the dummy column created earlier to the tracking date column. Now when you write the data to DB, your tracking column will have the desired date.
Derived Column Transformation