I am new to Qlik Sense and I am facing a challenge.
I need to create different visualizations using different charts, but on all of them having the capability to change its parameters, i.e., using different variables. I need to combine variables in a way that if Year 2015 is selected, it picks 2014 as Previous, other just use 2016 and 2015 as Previous Year.
Also, if Canada is selected, show Sales in CAD, otherwise show sales in USD. I still need to add another variable to switch between Net Sales and Gross Sales.
In short, I have 4 variables that I have to work with and there are 16 combinations. I would have to create a long IF THEN condition statements, prone to errors.
I read an article about creating Aggregation Fields and create variables based on the aggregation fields.
Could anyone advise what could be the best solution?
1. We display our sales dashboard in periods of two years, and show the growth compared to previous year. So, for this solution the users will only be able to select one year at a time, and see two years of data at a time, Default year will be current year (2016) and last year, and if user selects 2015, then 2014 is last year's data.
2. Yes, Canada sales in CAD has its own field, the conversion happens in the data source, which then gets loaded into Qlik in CAD already.
3. Net Sales and Gross sales are different fields as well. Only one value, at this time, will be displayed. So users can choose between Net or Gross, but Gross is the default value. We could organized these two fields to be displayed side by side, but users want to see them individually.
As far as Year & Previous Year - I normally use a MAX([YearField]) to return the selected year (takes care of multiple selections) and store the results into variables (previous year obviously being MAX([YearField])-1)
Net & Gross could be similar - put an IF statement into the displayed measure, base on a variable setting
e.g. SUM(IF(vSales = 'Net',[Net Sales],[Gross Sales]))