Handling dimension with empty names in icCube - iccube

How can I get icCube to handle a dimension where there are empty values in the backing table? I get the following error message from icCube when I try to scan our tables:
Data table 'public.accounting_area_dim', line '22' : The member key:'22' has no name (nameColumn:area) (level:[Area].[Area].[Area])
This is absolutely correct, there are empty strings in the dimension table - I'd like to treat it as "Unknown" or something similar, is this possible in icCube?

You can transform the empty string into something else within the table definition as following:
Hope that helps.

Related

How do I remove special characters from an extracted value of a query?

I'm using the following code to get a user's recovery_token and store it in a variable:
Connect To Database psycopg2 ${DB_NAME}
... ${DB_USER_NAME}
... ${DB_USER_PASSWORD}
... ${DB_HOST}
... ${DB_PORT}
${RECOVERY_TOKEN}= Query select recovery_token FROM public."system_user" where document_number like '57136570514'
Looking at the log, the recovery_token is being saved as follows:
${RECOVERY_TOKEN} = [('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImU3ZGM4MmNjLTliMGQtNDc3OC1hMzM0LWEyNjM4MDU1Mzk1MSIsImlhdCI6MTYyMzE5NjM4NSwiZXhwIjoxNjIzMTk2NDQ1fQ.mdsrQlgaWUol02tZO8dXlL3KEwY6kqwj5T7gfRDYVfU',)]
But I need what is saved in the variable ${RECOVERY_TOKEN} to be just the token, without the special characters [('',)]
${RECOVERY_TOKEN} = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImU3ZGM4MmNjLTliMGQtNDc3OC1hMzM0LWEyNjM4MDU1Mzk1MSIsImlhdCI6MTYyMzE5NjM4NSwiZXhwIjoxNjIzMTk2NDQ1fQ.mdsrQlgaWUol02tZO8dXlL3KEwY6kqwj5T7gfRDYVfU
Is there any way I can remove the special characters?
Thanks in advance!!
The returned value is a list of tuples, a two-dimensional matrix (e.g. a table); if you have queried for 3 columns for example, the inner tuple would have 3 members. And if there were 5 records that match it, the list would have 5 tuples in it.
Thus to get the value you are after, get it from the matrix by its indexes (which are 0-based, e.g. the first element is with index "0"):
${RECOVERY_TOKEN}= Set Variable ${RECOVERY_TOKEN[0][0]}

teradata : to calulate cast as length of column

I need to use cast function with length of column in teradata.
say I have a table with following data ,
id | name
1|dhawal
2|bhaskar
I need to use cast operation something like
select cast(name as CHAR(<length of column>) from table
how can i do that?
thanks
Dhawal
You have to find the length by looking at the table definition - either manually (show table) or by writing dynamic SQL that queries dbc.ColumnsV.
update
You can find the maximum length of the actual data using
select max(length(cast(... as varchar(<large enough value>))) from TABLE
But if this is for FastExport I think casting as varchar(large-enough-value) and postprocessing to remove the 2-byte length info FastExport includes is a better solution (since exporting a CHAR() will results in a fixed-length output file with lots of spaces in it).
You may know this already, but just in case: Teradata usually recommends switching to TPT instead of the legacy fexp.

(rdlc) HOW to extract/display values of an array parameter

Calling all RDLC expert out there.
When displaying the values of the parameter(which the values is in array) to a tablix or table, it only displays the first value data of the array.
Which looks like this.
I want to display the 626 datas of the array to be displayed individually in rows.
There are about 626 datas inside the array named Testparameter, but it seems to that it only displays the first value of the array.
Maybe I must be missing something in the expression in reproducing the values.
This is the expression that I am using
=Parameters!Testparameter.Value
I have also tried JOIN expression but it displays all the 626 datas inside the column.
=Join(Parameters!Testparameter.Value,", ")
Whic resulted to this.
Any ideas what I am doing wrong? or is this possible?
Thank you in advance.
It seems that the dates returned from the parameter have an enter (\n) or some spaces, what you can try is to replace all the string \n or spaces to empty string and check.

How to get text rendered in the cells?

How can I get text rendered in the cells? I have tried the following :
[1] $(gridId).jqxGrid('getcellvaluebyid', rowID, columnFields[j])
[2] $(gridId).jqxGrid('getcelltextbyid', rowID, columnFields[j])
However, I only get the actual values of the cells like flags and status codes instead of the actual flag names and status names rendered on the specific cell (using cells renderer).
Please help.
Have you tried by creating an Array variable and caching the cellsrenderer result using that Array. After that you can access the rendered cell content using your Array and your array keys.

SQLite: result of mathematical operation always is a text

I created the following table:
CREATE TABLE test (a INT,b INT);
After I inserted some data:
INSERT INTO test VALUES(1,2);
When I execute this SELECT:
SELECT cast(b as real) as x, a * b as y FROM teste
the fields "x" and "y" return with datatype TEXT. I'm using Delphi and SQLiteStudio 2.1.5, and both return the same datatype.
I need that field x being real and y being int.
Someone could help me?
Sqlite does not have column data type. It is just text. Based on your expression, it will try to do the conversion for you. For your math expression, you need to do a cast to give it is a hint to delphi to create your desired column type.
For me it's strange that in Sqlite, column types are "recommendations". But analyzing this I changed my program. I created the fields manually with correct type. So the program start to work.
The problem is when you open a query and the Delphi create the columns automatically. In this case, the columns with cast or with mathematical operation are created like text field.

Resources