I have an issue when trying to use the IFS expression to perform calculations using the Order Capture Sample app. The expression to calculate totals on the Order Details table is as follows: [Product Id].[Price] * [Quantity]. This expression is used for all products. However, I am trying to customize the app so that each product has a unique calculation. When I enter the following expression: IFS([Product Id]=โStrawberryโ,[Product Id].[Price][Quantity].02,[Product Id]=โKiwiโ,[Product Id].[Price] * [Quantity] * .05,[Product Id]=โRaspberryโ,[Product Id].[Price] * [Quantity] * .2) the Total disappears from the UX and no total is calculated. Any Suggestions?
Solved! Go to Solution.
I actually just figured it out. I was using an incorrect reference.
Try setting a default case IE IFS(Exp1,Result1,Exp2,Result2,true,โDefaultโ)
This will tell you if the problem is in your Exp statements or in the formulas. If it doesnโt make it to the Default then your Result expressions are giving the error and if you make it to the Default then the Exp statements are wrong.
I set the default and the Total was instantly filled in with my default case. It appears that the Total switched to requiring a user input instead of making a calculation.
My guess is that your Product Name is not the same as your Product Id. Try using something like this:
[Product Id].[Product Name]=โStrawberryโ
I made the change to Product Name and had no success. If I use a simple formula that does not include the IFS, then it works fine. The issue occurs when using the IFS expression.
Letโs get some screenshots of your data.
Precede all decimal points with a 0
(e.g., .02
should be 0.02
).
I placed the zero in front of my decimals. The issue still exists. If I use a simple IF expression, the calculation takes place and the column is completed. If I use an IFS expression, the calculation does not take place and the โTotalโ column is not completed. I am using the sample app โOrder Capture.โ Could the issue be caused by the Ref_Rows expressions or the virtual columns?
Please post screenshots of the working expression and the non-working expression.
I actually just figured it out. I was using an incorrect reference.
User | Count |
---|---|
16 | |
10 | |
8 | |
5 | |
5 |