Hi All, I have a question and wondering whether you can help me out with this. If I have a field named A which has value A1 and A2. Then I'd like to sum the total sales for A2 only. I have created an IF calculation =if([A]='A2', Sum([Total_sales)])) under the Data --> Expression but the result was dash (-). Could you please point out the mistakes I made? Thanks in advance!
In your expression, there is small correction needed
=if([A]='A2', Sum([Total_sales)])) // Remove that
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Hi, thanks for your response. Cool, it works! By the way, I still don't get it and have some questions regarding this, hope you can help me out: 1. About the brackets you use, why should it that much? 2. What the difference between your logic and if it uses TOTAL like @Anil_Babu_Samineni did? Anyway, the result is the same, I'm just wondering about the difference 3. Why can't I use IF like I did before? Thanks before!
Hi, thanks for your response. Cool, it works! By the way, I still don't get it and have some questions regarding this as I replied above/below, hope you can help me out. Thanks before!
You can write the condition within the set analysis using a comma separator. like sum({<filed1={"cond1"},filed2={"cond2"}>}sales). When you write the expression it is calculated at every row level but if you want to ignore the calculation and get the total of certain dimension you can use the total function. You can search in help.qlik.com. Please mark the correct solution.