Need a special offer?Find out if your project fits.
+

Selected cell contains wrong recordIds

Closed
Vertti Mäkikyrö asked on November 13, 2023

Hi,
When pivoting the report as shown in the example, I noticed that the selected cell contains incorrect record IDs.

There is two cells in my example. Both cells are returning same record IDs.
Here's the link for your reference: https://jsfiddle.net/zbjr26mx/33/
 

3 answers

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 13, 2023

Hello, Vertti!
 
Thank you for reaching out to us.
 
As a first step, we want to explain how the pivoting in Flexmonster works.
In the provided example, to calculate the current measure for the cell ["row", "current"], we pick all the rows from the original data source with the date = "01" and level1 = "row", and aggregate the values from current field. In the provided data source, two rows satisfy these conditions, with recordID 1 and 13, and the value in ["row", "current"] cell is the aggregation of 120000 and null.
 
Therefore, we kindly recommend dividing the data into "current" and "previous" using an additional string field instead of two measures.
For example, we can add the type field:

data: [{
          "datasource": "Current",
          "recordId": 1,
          "month": "01",
          "date": "01",
          "amount": 120000,
          "type": "current",
          "level1": "Row"
        },
        {
          "datasource": "Previous",
          "recordId": 13,
          "month": "01",
          "date": "01",
          "amount": 60000,
          "type": "previous",
          "level1": "Row"
        }
]

 
And add a new field to the slice:

"slice": {
      columns: [{
          uniqueName: "date",
          sort: "unsorted"
        }, {
          uniqueName: "type"
        },
        {
          uniqueName: "[Measures]"
        }
      ],
//other slice properties
}

 
And aggregate values by amount:

"measures": [{
          uniqueName: "amount",
          aggregation: "sum"
        },
//other measures
]

This way, Flexmonster will divide the aggregated values into current and previous automatically, and the returned recordID won't be joined.
We have prepared a JSFiddle example to illustrate the idea: https://jsfiddle.net/flexmonster/s2x9rk7v/.
 
Hope you will find our answer helpful.
 
Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 21, 2023

Hello, Vertti!

Hope you are doing well.

Our team is wondering if you had some time to look through our previous answer. Could you please let us know if it was helpful in working with recordID?

Looking forward to hearing from you.

Kind regards,
Solomiia

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster November 28, 2023

Hello, Vertti!

Hope you are having a great week,

Just checking in to ask if our approach was helpful in working with recordID.

Looking forward to hearing your feedback.

Kind regards,
Solomiia

This question is now closed