Multiple replaces on a column in an AWS Quicksight dataset - amazon-quicksight

I'm very new to AWS Quicksight and I'm trying to do multiple replaces on a column in a dataset. I thought that something like this calculated field would work:
replace(replace({Registered Owner}, 'LIMITED', 'Ltd'),{Registered Owner},'kft', 'Ltd')
But it doesn't look like you can nest Replace statements.
Any one can assist on how i might achieve this?
Regards,
Mark

Here is an example of using nested replace -
replace(replace(replace({Email}, '#','ATTHERATE'),'.com','.org'),'email','quicksight')
Will result into following -

Related

An error when trying to aggregate using data.table

table users,
I have the code as shown in the screenshot and the resulting error. Unfortunately I can't share the data due to privacy issues. Does anyone have an idea of the error?
Thanks in advance!
When you use by, the resulting data.table should have one row per group. However, you try to assign multiple values to each of these lines by using unique() (given there are multiple unique values per group). You either have to wrap them in list() or paste(..., collapse = ", ") or something like that to just get a single value in each by.

A dynamic text field in QuickSight dashboard

I have a dashboard and I want to show when the dataset was created. I have a column in my dataset and I was trying to use QS Parameters or Calculated Field, but no luck. I can create a static parameter and output that value in a title of visualization, however I can't dynamically select max(my_last_date_filed) from the dataset.
Any ideas?
I used Insight type, where I defined variable as following: Maximum.timeValue.formattedValue, which solved my problem

Informatica cloud: use field in pre/post sql commands

I am trying to delete a set of data in the target table based on a column (year) from the lookup in IICS (Informatica Cloud).
I want to solve this problem using pre/post sql commands but the constraint is I can't pass year column to my query.
I tried this:
delete from sample_db.tbl_emp where emp_year = {year}
I want to delete all the employees in a specific year i get from lookup return
For Ex:
I got year as '2019', all the records in table sample_db.tbl_emp containing emp_year=2019 must be deleted.
I am not sure how this works in informatica cloud.
Any leads would be helpful.
How are you getting the year value? A pre/post SQL may not be the way to go unless you need to do this as part of another transformation, i.e., before or after the transformation runs. Also, does your org only have ICDI, or also ICAI? ICAI may be a better solution depending on the value is being provided.
The following steps would help you achieve this.
Create an input-output parameter in your mapping.
Assign the result of your lookup in an expression transformation to the parameter using SetMaxVariable
Use the parameter in your target pre SQL as
delete from sample_db.tbl_emp where emp_year = $$parameter
Let me know if you have any further questions

Freemarker Help: Pass Data to List Directive for Sorting

First time poster and a Freemarker novice. I'm hoping someone can assist on this. I am currently referencing data from a 1-to-many table using the <#data> directive. I want to sort the results in a particular field order, but I think that can only be done by the <#list> directive. Here's what I have so far:
There's a CART_ABANDONMENT table with the following fields:
CUSTOMER_ID_
PRODUCT_ID
PRODUCT_NAME
PRODUCT_PRICE
ABANDONED_DATE
<#data CART_ABANDONMENT as abandonment><br>
<#filter CUST_ID="${CONTACTS_LIST.CUSTOMER_ID_}"><br>
<#fields PRODUCT_ID PRODUCT_NAME PRODUCT_PRICE ABANDONED_DATE><br>
${abandonment.PRODUCT_NAME} ${abandonment.PRODUCT_PRICE}<br>
</#data>
What I want to do is to list all related results (by CUSTOMER_ID_) and sort them by PRODUCT_PRICE, descending.
It may be something simple, but I haven't been able to find the answer.
Any guidance would be appreciated.
Freemarker is powerful tool tool but it's just template engine.
It has the sort directive for list, but it can be applied only to built-in types: String, Number and Date.
You may convert list of you complex type to one or more lists of built-in types and use ?sort in template.
Another way is to pass already sorted(as you want) list to template before processing.
What you want sounds like something that should be solved on the database (SQL) level, especially where you say "list all related results (by CUSTOMER_ID_)". FreeMarker is only the V (for View) in MVC.

Qlikview: Matching columns of two indirectly link tables does not work

Following is the data model of the dashboard I am facing problem in:
http://blob:http://stackoverflow.com/f3e40cfe-e009-4d03-bcf5-b7b4305c18c4
Now, what i want to achieve is that in Case there is a filed named Manufacturing_Date. And in MWODefetcs there is a field named Defect_Date. What i want is that when ever a record is selected from a table containing cases from Case corresponding records are shown in another table based on the exact match of Manufacturing_Date=Defect_Date.
As simple as it sounds, i can not seem to accomplish it. I have tried the following expressions to no avail:
Count({<[Defect_Date_text]=p([Manu_text]),FaultID=,DEFECT_CODE=>}MFG_BARCODE_NUM)
sum({$<Defect_Date ={"=$(Manufacturing_Date__c)"}>}Defect_Date)
Do the 2 tables need to be directly linked. Is it the intermediary iFaults table that is preventing me to accomplish it?
Please help.
you should use the P() set expression like this:
sum({$<Defect_Date =P(Manufacturing_Date__c) >}Defect_Date)

Resources