I’m loading an analytics workbook using query.load...
# suitescript
m
I’m loading an analytics workbook using query.load and then I’m doing myLoadedQuery.run().asMappedResults(); and I’m getting back this error: “SSS_DUPLICATE_ALIAS”. I found that it comes from join columns. I tried renaming these in both the workbook and the dataset and yet I still get the error. Has anyone solved this?
s
You could try editing those columns with duplication and giving one or more of them a new alias
m
i asked NS about it and they didn’t have a good answer. i ended up doing this, which is probably not ‘recommended’ and doesn’t work for all circumstances:
Copy code
const billingDetailQuery = query.load({
        id: 'custdataset_billingeventorderdetail'
      })

      // this allows .asMappedResults() exports!
      billingDetailQuery.columns.forEach(m => (m.alias = m.getJoins()))
m
ok, thanks for the snippet! I will check this out.