Forum Discussion
wimsangers
Helper I
7 years agoMeasure to exclude transactions
Hello everybody, I am stuck with my measure. I am trying to calculate our margins per transaction. However I want to exlcude the transaction that have a contract package with the name: PON-laadbu...
- Anonymous7 years ago
[Your Measure] = var __transactionIdsToExclude = calculatetable ( values ( Query1[cdr_id] ), Query1[contract_package] = "PON-laadbundel" ) var __transactionsToKeep = except ( values ( Query1[cdr_id] ), __transactionIdsToExclude ) var __result = calculate( [test chargecards], __transactionsToKeep ) return __result
Best
Darek
wimsangers
Helper I
7 years agoHi Anonymous ,
You are absolutely right about the names that I use. However, this is a test dataset. I am first trying to get the right measures before I import all the data.
Regarding your solution, It still includes the transaction :smileysad:. I think this is because this measure filters out the row that contains the PON-laadbundel, but is does not remove the other row as this one does not contain PON-laadbundel. So I still get a margin of -8,73 for this transaction.
Anonymous
7 years agoNot applicable
[Your Measure] = var __transactionIdsToExclude = calculatetable ( values ( Query1[cdr_id] ), Query1[contract_package] = "PON-laadbundel" ) var __transactionsToKeep = except ( values ( Query1[cdr_id] ), __transactionIdsToExclude ) var __result = calculate( [test chargecards], __transactionsToKeep ) return __result
Best
Darek
- wimsangers7 years ago
Helper I
Thank you very much Anonymous.
You've made my day!
Wim