Imagine having a dataset like this:
const array =
[
{ "CategoryDesc":"SEC Violations (Insider Trading, Securities Fraud)", "SubCatDesc":"BBC"}
{ "CategoryDesc":"SEC Violations (Insider Trading, Securities Fraud)", "SubCatDesc":"BBC"}
{ "CategoryDesc": "FRD" ,"SubCatDesc":"VRD"}
{ "CategoryDesc": "FRD" ,"SubCatDesc":"VRD"}
{ "CategoryDesc":"SEC Violations (Insider Trading, Securities Fraud)", "SubCatDesc":"BBC"}
{ "CategoryDesc":"FRD", "SubCatDesc":"BBC"}
]
We want to extract distinct values based on both CategoryDesc and SubCatDesc:
[ { "CategoryDesc":"SEC Violations (Insider Trading, Securities Fraud)", "SubCatDesc":"BBC"}
{ "CategoryDesc": "FRD" ,"SubCatDesc":"VRD"}
{ "CategoryDesc":"FRD", "SubCatDesc":"BBC"}
]
Can anyone provide guidance on how to achieve this?