Total for value with both numeric and string conditions
Posted: Thu Dec 20, 2018 4:15 am
Please see the two statements below.
varSum = Totals.Sum (DataDataset, Dataset.InvServiceDt_IMonth == varMo ? Dataset.Charges :0);
varSum2 = Totals.Sum (DataDataset, Dataset.BA_Name == varBA ? Dataset.Charges :0);
varSum, varSum2, varMo, and varBA are variables (varBA is a string, the other three are integers or decimals). Each one of these statements works correctly separately. I need to apply both conditions to a single instance of the total, but I have not been able to figure out the correct structure to combine them. What do you recommend?
Thank you for for your assistance.
~ Judy H.
varSum = Totals.Sum (DataDataset, Dataset.InvServiceDt_IMonth == varMo ? Dataset.Charges :0);
varSum2 = Totals.Sum (DataDataset, Dataset.BA_Name == varBA ? Dataset.Charges :0);
varSum, varSum2, varMo, and varBA are variables (varBA is a string, the other three are integers or decimals). Each one of these statements works correctly separately. I need to apply both conditions to a single instance of the total, but I have not been able to figure out the correct structure to combine them. What do you recommend?
Thank you for for your assistance.
~ Judy H.