Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am new to Qlik so please bear with me.
I want to sum sales expressed as a percentage by product type as dimension if it equals to a certain year for a bar chart.
Here is what I have so far: Sum(if(Year=2018 , [Sales]) / (sum [Sales])
However, it is throwing up a error. Can anyone help please?
I got it to work in the end. I needed to specify the year in the 2nd part of the expression
the expression that worked was: = Sum({< Year = {'2018'} >} [Sales])/Sum(total {< Year = {'2018'} >} [Sales])
You want only sales data to show for 2018? If yes, you can use like
= Sum({< Year = {'2018'} >} Sales)/Sum(TOTAL Sales)
Thanks very much that worked, however my bar chart for all products (dimension) is not summing to 100% for 2018. Is there something missing from the expression?
I am actually summing quantity of products for 2018 but that should not make a difference. I do not understand why it's not summing to 100%
Can you share some sample data or a file to work on?
I got it to work in the end. I needed to specify the year in the 2nd part of the expression
the expression that worked was: = Sum({< Year = {'2018'} >} [Sales])/Sum(total {< Year = {'2018'} >} [Sales])
ok good. Close the thread marking correct helpful response accordingly.