Ken
08/08/2022, 8:57 PMvar transactionSearchObj = search.create({
type: "transaction",
filters: [
["type", "anyof", "CashSale", "CustCred", "CustInvc", "CashRfnd"],
"AND",
["subsidiary", "anyof", subsidiary],
"AND",
salesChannelArray,
],
columns: [
search.createColumn({
name: "item",
summary: "GROUP",
label: "Item",
}),
search.createColumn({
name: "formulacurrency",
summary: "SUM",
formula:
"(case when ( {trandate} BETWEEN TO_DATE('" +
r1StartDate +
"','mm/dd/yyyy') AND TO_DATE('" +
r1EndDate +
"','mm/dd/yyyy') ) then {netamount} else 0 end)",
label: "R1Net",
}),
search.createColumn({
name: "formulanumeric",
summary: "SUM",
formula:
"(case when ( {trandate} BETWEEN TO_DATE('" +
r1StartDate +
"','mm/dd/yyyy') AND TO_DATE('" +
r1EndDate +
"','mm/dd/yyyy') ) then {quantity} else 0 end)",
label: "R1QtySold",
}),
search.createColumn({
name: "formulacurrency",
summary: "SUM",
formula:
"(case when ( {trandate} BETWEEN TO_DATE('" +
r2StartDate +
"','mm/dd/yyyy') AND TO_DATE('" +
r2EndDate +
"','mm/dd/yyyy') ) then {netamount} else 0 end)",
label: "R2Net",
}),
search.createColumn({
name: "formulanumeric",
summary: "SUM",
formula:
"(case when ( {trandate} BETWEEN TO_DATE('" +
r2StartDate +
"','mm/dd/yyyy') AND TO_DATE('" +
r2EndDate +
"','mm/dd/yyyy') ) then {quantity} else 0 end)",
label: "R2QtySold",
}),
],
});
You can see that I have two column with same name, is there a way for me to grab the second “formulanumeric”
I tried
result.getValue({
name: "formulacurrency",
summary: "SUM",
label: "R1Net",
});
battk
08/08/2022, 8:59 PMbattk
08/08/2022, 9:00 PMbattk
08/08/2022, 9:00 PMKen
08/08/2022, 9:00 PMKen
08/08/2022, 9:00 PMbattk
08/08/2022, 9:00 PMKen
08/08/2022, 9:00 PMresult.columns[i]
thenKen
08/08/2022, 9:00 PMKen
08/08/2022, 9:52 PMbattk
08/08/2022, 10:00 PMbattk
08/08/2022, 10:02 PMKen
08/09/2022, 3:59 PM