We are creating an export of sales lines in Novulo. If a sale consists of multiple saleslines, we want the value to appear only on the first line of that sale, while the other saleslines remain empty.
If you want to export a value only for 1 sales line in a sales, you can use the following approach:
{
saleslines,
<
id,
string:if(
saleslines:first({
saleslines,
this,
boolean:and([id.islower(parent.id),sales.equals(parent.sales)])
}).isnull(),
"I am the first",
"I am not the first"
)
>,
this.sales.id.equals(1)
}
Run the expression in your debugger to see the result. Switch the filter on sales 1 to an ID that suits you.
In my case, i got this result:
40903 "I am the first"
40904 "I am not the first"
40931 "I am not the first"
40932 "I am not the first"
40933 "I am not the first"
40934 "I am not the first"
40935 "I am not the first"
Use an IF statement to either display value A or B. Or, in your case, either the amount of the expected transaction or ā0ā.
Define a condition in the IF that is only valid for 1 sales line per sales. In each sales, there can be only 1 sales line with the lowest ID. Or in other words, there does not exist a sales lines with a lower ID in the same sales for the sales line which has the lowest ID in the sales.
This approach is not very fast, but it should work. I hope this helps.
What is the purpose of your export? If you are creating an exportdefinition for an activity, you can use a nested grid. Also you can display saleslines and let word do the thinking, if you donāt use contentblocks.
If you make an excelsheet, I would wonder why you wouldnāt want the value, because creating tables is a lot easier that way. if you want to make an xml export, just nest it under the sales and donāt export the salesnumber under the saleslines, use ../number instead to get it.
The purpose of the export is to generate a financial dataset that combines multiple elements into an XLSX file using Novuloās report export functionality. (That works great ). This file is then imported into another financial software system. To ensure data integrity, the export must avoid duplicate rows. In this case the expectedtransaction amount value must not appear repeatedly for each salesline in an order. If it does, it could create the false impression that multiple expected transactions are associated with the same order. This approach ensures clarity and accuracy in the exported data structure.
mmh the expression does not seem to use the approach that I suggested regarding the āfirst salesline of a salesā. This part is missing as a condition in the IF:
Furthermore, is XLSX the only option for you?
I have the feeling that for what you are trying to achieve, a nested file like an XML or a JSON would be better suited. Something like this: