KingswaySoft: Nav source component filter InvoiceLines - nav

I need to filter the Invoice Lines so that it only reads the lines where the Invoice Header exists.
For instance:
where InvoiceId in (Select InvoiceId from PostedSalesInvoices)
Is it possible to encode it with XML?
Thanks a lot

Related

Oracle Apex 22.21 - Chart Page - Bar Type - Datepicker - How to update the source query to include a count and group by day

This question is a follow up to another SO question
I want a bar chart to show the amount of orders in a given date or range. Koen's updated answer shows:
'The "Value" is the amount of orders on each day. Update your source query to include a count of the orders and group by day. Then make your value attribute the column that has the count.'
How would I go about doing this?
Summary: I have a table ORDERS which contains column ORDER_DATE. I have created a Chart as a Bar type. I want the chart to show the amount of orders in a given date or range.
I'm following this Youtube tutorial which shows how to create a datepicker that returns a range in a Report. I'm trying to replicate this in a chart.
What I've done so far
Created datepicker items P5_DATE_FROM and P5_DATE_TO
Changed the Series Source Type to SQL Query
select ORDER_ID,
ORDER_NUMBER,
ORDER_DATE,
STORE_ID,
FULL_NAME,
EMAIL,
CITY,
STATE,
ZIP_CODE,
CREDIT_CARD,
ORDER_ITEMS,
APEX$SYNC_STEP_STATIC_ID,
APEX$ROW_SYNC_TIMESTAMP
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
Source Page Items to Submit added P5_DATE_FROM,P5_DATE_TO
I basically followed the exact steps of the video.
However, on the Page Designer I cannot save and run page until I select Column Mapping - Label and Value. I've set the Label as ORDER_DATE but I am unsure of what to select for the Value.
Setting the Value to ORDER_DATE shows an error Ajax call returned server error ORA-01403: no data found for CHART Count Orders by Date.
and selecting any other Value such as ORDER_NUMBER or ZIP_CODE populates the chart with the actual integer value of the column (ex: ZIP_CODE returns a chart of x-axis: date, y-axis: actual zip code numbers)
-----------UPDATE----------
Per Koen's answer, I've updated the Source SQL Query to below but I am now receiving an error.
And if I copy the exact query that Koen suggested, I run into below:
I did some messing around and found if I include APEX$SYNC_STEP_STATIC_ID and APEX$ROW_SYNC_TIMESTAMP the missing expression error goes away but instead I receive the GROUP BY error.
Something like this (untested) should work. Use TRUNC to ensure all orders on the same date are grouped (since date has a time portion, you'd have a different column for each different date time. Use ORDER_DATE as label and ORDER_COUNT as value.
select COUNT(ORDER_ID) AS ORDER_COUNT,
TRUNC(ORDER_DATE) AS ORDER_DATE,
from ORDERS_LOCAL
where ORDER_DATE between TO_DATE(:P5_DATE_FROM,'YYYY-MM-DD') and TO_DATE(:P5_DATE_TO,'YYYY-MM-DD')
GROUP BY TRUNC(ORDER_DATE)

How to filter selective data from a postgres using PDI components?

For example : I have a column named description, in this column there are millions of records. I just want to filter records only with "a=x" (where x can be any value) using pentaho?.This pattern can be at any position in the column
Assuming that in your description column you always have a value after the pattern 'a=' you could just do the filtering in PostgreSQL using LIKE
SELECT
description
FROM
your_table
WHERE
description LIKE '%a=%'
Then you just put this query inside a Table Input step in your transformation.

Formatting a portal in FileMaker 13 to show related text only and not keys

I am using FileMaker Pro 13. I need to add Portal to show data from related table.
Some fields which I wanna add to Portal are "Foreign keys" from that related table that are linked-related to third table.
Results I am getting in Portal from those fields are numbers, but I need data (text) from that third table that is related to that "Foreign key".
Is it possible to create portal that shows text related to that foreign key, and if it is, how to achieve that?
Thanks a lot!
Example schema is on link https://www.lucidchart.com/invitations/accept/e45dfdfd-185d-46c8-ad9e-e8e8dc270ee7
In general words, I want to add Portal on layout based on Table3, so I can view related data from Table2, and it would have fields tbl2item, TBL1_foreign key (from where I pull data from Table 1 when I enter data in Table 2, using pop up menu). And in Portal data I need TBL1_foreign key to be represented as text from related table instead of auto-numbers.
Assuming the relationship:
Table 1 --> Table 2 --> Table 3
You are in the layout based on Table 1. Make sure there is relationship to Table 3 and it is in the same group (TOG) in Manage Databases. Just place the field with text from the Table 3 on your portal row and it should work.
Make sure you select the correct relationship for Table 3. In drop-down list it should be in "Related" group. Should look like "Table 3::myFiled" on the layout, with the name the same as the name of your table instance (TO) from "Manage database" which could be different from your base table name
The other option would be to use value list.
I do not see your file, so if it does not work for you, post more details about your setup.

Iterating through data from a SOAP Response to store in an Excel Worksheet

I know that there is a DataLoop that can be used to iterate over elements in a DataSource, but how do I iterate over elements that I am extracting into a DataSink?
I have a SOAP Response containing 100 records and I need to extract different elements from each record and store the data in an Excel worksheet. Currently I am extracting the data with a Property Transfer and using a DataSink to save it to a spreadsheet. Below is an example of the code that takes the first author name in each record and transfers it to the DataSink (this is within the Source section of the Property Transfer window):
declare namespace ns2='http://woksearch.v3.wokmws.thomsonreuters.com';
declare namespace ns1='http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord';
<full_name>
{
for $id in //ns1:name[1]//ns1:full_name[1]
return string($id)
}
</full_name>
However, this takes ALL the names from every record as a list and stores them in a single cell in the Excel worksheet (similarly for the other data fields I'm extracting). How can I do the Property Transfer for the 1st record into the DataSink, then iterate back to do the Property Transfer for the 2nd record, and so on until I have iterated over all 100 records?
Thank you for your help!
John
EDIT:
Here is an example of the XML Document I am trying to retrieve data from, I have taken out some elements as it is extremely long otherwise!:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:retrieveByIdResponse xmlns:ns2="http://woksearch.v3.wokmws.thomsonreuters.com">
<return>
<queryId>2</queryId>
<recordsFound>100</recordsFound>
<recordsSearched>50601246</recordsSearched>
<records><records xmlns="http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord">
<REC r_id_disclaimer="ResearcherID data provided by Thomson Reuters"> <UID>WOS:000266862400001</UID><static_data><summary><EWUID><WUID coll_id="WOS"></WUID><edition value="WOS.SCI"></edition><names count="3"><name seq_no="1" addr_no="1" role="author" reprint="Y"><display_name>Buijs, Arjen E.</display_name><full_name>Buijs, Arjen E.</full_name> ... etc ... </REC>
<REC> ... etc ... </REC>
<REC> ... etc ... </REC>
</records></records>
</return>
</ns2:retrieveByIdResponse>
</soap:Body>
</soap:Envelope>
All the data I am extracting lies within these <REC> tags, so I am trying to extract fields like <full_name> from each <REC> and then pass it into an Excel spreadsheet.
I have managed to display the data exactly as I want it by using a DataSource step just after this SOAP Request/Response which extracts all the necessary fields by using the DataSource as XML and then referencing the XPath of each in the Row and Column sections. When I click the green test button in this window, the Data Log displays all 100 records with a column for each field type. When I try to pass all this data into a DataSink however, it only copies over the first row 100 times into the Excel worksheet.
Sorry, I would post a screenshot but you need reputation 10+ to do that!
EDIT 2:
For example, for the field <full_name> I have made a property called Author 1 in the DataSource, set to XML, Source Step is the SOAP Request and Source Property is the Response (the data listed in the code block above). In the Row XPath I then have:
declare namespace ns2='http://woksearch.v3.wokmws.thomsonreuters.com';
declare namespace ns1='http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord';
//ns2:retrieveByIdResponse[1]/return[1]/records[1]/ns1:records[1]/ns1:REC
In the Column XPaths I have:
declare namespace ns1='http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord'; ns1:static_data/ns1:summary/ns1:names/ns1:name[1]/ns1:full_name/text()
When I run the test in this window, this displays a column with the header 'Author 1' and then lists 100 different names. When I transfer this to a DataSink however, it only lists the first row 100 times in the worksheet.
Your query will put all the first names into a single XML element called full_name. However I think you want to output them independently, but then all you would need is this:
declare namespace ns1 = 'http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord';
//ns1:name[1]//ns1:full_name[1]
You need to follow a sequence something like this:
SOAP call to retrieve your data.
DataSource with type = xml to grab all the records, one at a time.
DatasSink to write each one record to your Excel.
Loop back to #2 to iterate over all the records.

How to Filter paginated table with "Picnet Table filter"?

I am using "Picnet Table filter" for filtering my tables.
I am using display tag for displaying my table data.
I have hnadreds of records to show in the table and hence I have used pagination where page size is 50.
I am showing 50 records per page.
When I use this plugin to filter the data in the table, it only filters data on the current page.
Is there any way we can make "Picnet Table filter" to filter the data on the entire list rather than in just the page?
Please help.
Thanks