We are trying to build better dynamic reporting in our SQL queries from SAP HANA. Currently we either have to hard code the values, or we have a python tool which we update the values, but we are looking to point Tableau Server direct to SAP HANA and not have to go in and update the date ranges we are looking at.
We are looking to get a dynamic date selection for current and prior year where the structure is YYYYMMM in both the FROM and TO functions.
FROM "_SYS_BIC"."fvr.Revenue.FVRRsummary/ST_FVRR_COPA" (
'PLACEHOLDER' = ('$$IP_FROM_FISCAL_YR_PER$$', '2019001'),
'PLACEHOLDER' = ('$$IP_TO_FISCAL_YR_PER$$', '2020012')
There's no need to use external tool to update parameter's values, because HANA Calculation View has ability to calculate parameter's dafault value (e.g. when no external value passed to it from SQL/MDX).
You can use simple calculations to set default value for parameter in parameter definition screen. They can be based on constants, some other parameter's value or meta-information (like current date, logon language).
For your case you can use a parameter type Direct and set default values as follow:
IP_FROM_FISCAL_YR_PER: format(addmonths(now(), -12), 'yyyy"001"').
IP_TO_FISCAL_YR_PER: format(now(), 'yyyy"012"').
Related
I am quite new to GBQ and any help is appreciated it.
I have a query below:
#Standard SQL
create or replace table `xxx.xxx.applications`
as select * from `yyy.yyy.applications`
What I need to do is to add today's date at the end of the table name so it is something like xxx.xxx.applications_<todays date>
basically create a filename with Application but add date at the end of the name applications.
I am writing a procedure to create a table every time it runs but need to add the date for audit purposes every time I create the table (as a backup).
I searched everywhere and can't get the exact answer, is this possible in Query Editor as I need to store this as a Proc.
Thanks in advance
BigQuery doesn't support dynamic SQL at the moment which means that this kind of construction is not possible.
Currently BigQuery supports Parameterized Queries but its not possible to use parameters to dynamically change the source table's name as you can see in the provided link.
BigQuery supports query parameters to help prevent SQL injection when
queries are constructed using user input. This feature is only
available with standard SQL syntax. Query parameters can be used as
substitutes for arbitrary expressions. Parameters cannot be used as
substitutes for identifiers, column names, table names, or other parts
of the query.
If you need to build a query based on some variable's value, I suggest that you use some script in SHELL, Python or any other programming language to create the SQL statement and then execute it using the bq command.
Another approach could be using the BigQuery client library in some of the supported languages instead of the bq command.
Im trying to convert Oracle SQL Developer Select Statement into an Oracle BI function.
Seems like Evaluate is the way to go but the syntax is a little confusing so any help is appreciated. The SQL Dev Code is below for 2 select Statements:
TRIM(TO_CHAR(COUNT(*), '999,999,999,999,999')) AS Row_Count
TRIM(TO_CHAR(SUM(N_MODEL_ISS_AGE), '999,999,999,999,999')) AS Age
Those bits of SQL are there for formatting the resulting number into a more "nice to read" format. OBIEE is an Analytical platform and formatting has nothing to do with querying data. You build your analysis, select the attributes and measures you want and on each column you will be able to set the format you want for the values. Formatting is separated from retrieving data as formatting is only something which matter for rendering.
On each column in the criteria tab of the analysis you have "Column Properties" > "Data Format". You either pick a predefined format or set to 'custom' and enter your own format mask.
I'm using a custom SQL query and parameters for start and end date ranges in a workbook that I've created. Currently the dashboard users need to enter a unix timestamp for the start and end parameters.
Instead of using the timestamp, I want someone using the dashboard to be able to choose a date using a date-selector, and I want the date that they selected to be converted into a unix timestamp (ex: 8/1/2018 = 1533081600) that is used as an SQL query parameter.
Does anyone know if this is possible with Tableau?
I have an SSRS report in which I've a Data Parameter. I want something like: Suppose I select a Date 10JAN2014, then when I return again to the same report I want the date parameter already set to 10JAN2014. Is it possible in SSRS ?
There is few options...
You need to create a table , use update statement which will put currently selected value ,then in
parameter properties use that column as default value.
You can also try to extract that value from execution log from report server.
I need to update a FileMaker Timestamp field with a timestamp taken from PHP and put into a script using the PHP API and executeSQL API and plugin
so
UPDATE table SET time ='2011-05-27 11:28:57'
My Question is as follows, how do I utilise the available scripting functions within Filemaker Pro 11 to convert the string that is being supplied within the SQL statement to an acceptable TimeStamp format for FileMake? or is it possible using the executeSQL plugin for FileMaker to do the conversion within the ExecuteSQL() function within the Execute SQL plugin?
I haven't tried it out, but it should work using CAST:
CAST( expression AS type [ (length) ] )
so, it should read:
UPDATE table SET time = CAST ('2011-05-27 11:28:57' AS TIMESTAMP)
However, please be aware that Filemaker's own ExecuteSQL() functions doesn't support UPDATE or INSERT INTO statements. You need to get a free extension from Dracoventions called epSQLExecute() in order to do this.
Hope this helps (someone).
Gary
You haven't given us much to go on, but my guess would be that you are updating a timestamp column with a string that does not match the required format.
You should convert your string to the appropriate object and then the update should work.