how to using parameter in modified java pentaho - dynamic

my boss wants to send email every morning with filename+date(yyyymmdd)
i've used "get file names" in the folder.
the problem is, the filename in "get file name" is only direct for example 'sales comparation.xlsx' but what we want is filename+date(yyyymmdd) to be 'sales comparison (20220701).xlsx.
I have prepared a parameter/variable that reads date(yyyymmdd), and added a "Modified Java Script Value" design so that the file is dynamically changed to the desired one.
I couldn't find on the forum what I was hoping for. can anyone help please send a kettle or a photo for easy understanding.
best regards
enter image description here
enter image description here
enter image description here

I think some ways to solve ur problem, i guess.
1.- Using "Join rows (cartesian product)" in the transformation where u get file name.
join rows, after thar concat values with Mod JS or concat fields.
2.- If u use "Set Variable" u should use "Get variable" like this:
Set Variables
Get Variables
Also u should declare in Transformation properties
Transf Prop
3.- Using parameters i did with "Copy rows to result", u should declare parameters in "Transformation" job entry configuration "parameters" like this:
Transformation configuration
Variables and parameters are diferent things.
Edit about comment:
sent values for parameters and variables
Set variable config

Related

can I get parameters from URL in pentaho?

Can I use a parameter from Carte's URL in a Job? Something like this:
http://localhost:8080/kettle/startJob/?name=myjob&xml=Y&testvar=filename.txt
I want to do this because I have a job to transform an input file but I want to change that filename dynamically, and creating a new XML file for each file is a bit nonsense.
I've tried many things and I couldn't find a solution :-(
All named parameters must be declared in the parameters tab of said JOB and KTR to be executed and receive the information passed from the URL parameters.

SSRS - How to show external image based on URL inside column

I am trying to show images for products inside a basic report. The image needs to be dynamic, meaning the image should change based on the SKU value.
Right now I am inserting an image into a table, setting to external, and i've tried:
=Fields!URL.Value
=http://externalwebservername/sku= & Fields!SKU.Value
="http://externalwebservername/sku=" & Fields!SKU.Value
I do not get any images in my table.
My stored proc has all the data, including a URL with the image I wan't to show. Here is a sample of what the URL looks like:
http://externalwebservername/sku=123456
If I enter the URL in the field without "=" it will show that ONE image only.
How should I set up the expression to properly show the external image based on a dynamic URL? Running SQL 2016
Alan's answer should work, but in our environment we have strict proxy/firewall rules, so the two servers could not contact each other.
Instead we are navigating to the file stored on our storage system.
We altered the URL column to point to file path in the stored procedure. Insert image, set Source to External and Value set to [URL].
URL= file://server\imagepath.jpg
As long as the account executing the report has permissions to access the URLs then your 3rd expression should have worked.
I put together a simple example as follows.
I created a new blank report then added a Data Source. It doesn't matter where this points, we won't use it directly.
Then I created a dataset (Dataset1) with the following SQL to give me list of image names.
SELECT '350x120' AS suffix
UNION SELECT '200x100'
UNION SELECT '500x500'
Actually, these are just parameters for the website http://placehold.it/ which will generate images based on the size you request, but that's not relevant for this exercise.
We'll be showing three images from the following URLs
http://placehold.it/350x120
http://placehold.it/200x100
http://placehold.it/500x500
Next, create a table, I used 3 columns to give me more testing options. Set the DataSetName to DataSet1 if it isn't already.
In the first column the expression is just =Fields!suffix.Value
In the second column I added an image, set it's source property to External and the Value to ="http://placehold.it/" & Fields!suffix.Value
I then added a 3rd column with the same expression as the image Value so I could see what was being used as the image URL. I also added an action that goes to the same URL, just to check the URL did not have any unprintable characters in it that might cause a problem.
The basic report design looks like this.
The rendered result looks like this.

Pentaho: Image in Pentaho form

I want to fetch image from local path (i.e: C:/Users/myname/sample.jpg).
Already tried with image icon on left of the form and set the value from the above both but the thing is i need to set the image from external . Like property file or kettle file.
please help me on this.im using Pentaho Designer 5.3.0
thanks in advance
If you want to get the location of the image from a property file, you have to think about how to get that value and take it to the report, that you can do with a kettle transformation, that takes the value you want from the properties file and send it to a Report, in the pdi there is a step called Pentaho Reporting Ouput, which makes a call to the report, to this you will pass as parameter the location of the image that you want to be displayed (the name of the parameter in the pdi and in the Report designes must be the same), you can do the following:
Create a parameter, which will be of type string, this will be the parameter will receive the location of the image on the disk
Add an image field instead of an image, and pass the parameter you created as a value
After you can upload the image you want, just pass the physical address to the report from the pdi.
I hope I help you

Best way to get a return tag from a sql SELECT command

I making a virtual assistant client for my University project and there is a slight problem in getting a tag return based on match string.
The system works like this:
1. The user speech input is converted into a string.
2. The string is then matched to column in table.
3. The matching column returns its id which then return two tags from another table.
The problem is for calling someone, how should I go around it?
I mean, the user will say something like this: "Call Arya", here I can't have predefined command for each person so I have to use "MATCH" or "LIKE" selectors in SQL.
But then if I use these selectors then it will return me the tag for say opening facebook app even if I just "facebook", as the commands for facebook will be "open facebook" or "run facebook".
So how to work around it. Please help.

Dialog box appear

I'm using decode for my query but when every time I run my query, there's a two dialog box appeared and need to input some number in those dialog box before to see the result. What should I need to remove it?
Please help me.
Thank you.
Here's some of my query..
SELECT (CODE_SALESROOM) POS_ID
,DECODE(CODE_SALESROOM, '60001', 'ABM SYSTEM'
,'50001', 'Acenet Unlimited Business Computer'
,'40002', 'RL My Phone - Robinsons Galleria') AS POS_NAME
FROM OWNER_DWH.DC_SALESROOM
WHERE CODE_SALESROOM NOT IN ('XAP', 'XNA', '10001')
Sounds like you're being prompted for substitution variables, because part of your query has somethling like and col = 'AT&T' - the ampersand is interpreted as a variable by default, and you're prompted for a value for &T (or whataver your actual value is interpreted as).
You can add set define off to your script to stop it looking for, and prompting for, a value when that is not what you want.
(The links are for SQL*Plus documentation, but much of that applies to SQL Developer as well; the documentation for that is a bit sparser),