Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a chart with two expressions,one for 2016, one for 2017 (and possibly more will be added later). Both expressions use the same Metric, [Gross Value of Sales]. The expressions have line style set to:
If([Week_Commencing]>vThisWeek,'<s3>','<s1>')
so that if the data displayed is for a week greater than the date the qvw was last reloaded (ie it's a forecast), then the line style will be dashed, not solid.
In addition, each expression is conditional on whether that year is selected in a list box, using respectively:
GetFieldSelections(WSSI_Year)like '*2016*'
GetFieldSelections(WSSI_Year)like '*2017*'
MY ISSUE:
if only one year is selected, in the list box, the line style works as intended. If both years are selected at the same time, both years display, but both with their lines all solid (<s1>). Note that data was last reloaded Week 46, 2016
Any help/ideas much appreciated
So you basically have 1 dimension (week) and three expressions, right? and you are using the same line style expression for all three of them?
If([Week_Commencing]>vThisWeek,'<s3>','<s1>')
I am not sure what your expression for each of the year is, but you need to use same set analysis in your line style expression
2016
If(Only({<SetAnalysis4m2016Exp>}[Week_Commencing]) > vThisWeek, '<s3>', '<s1>')
2017
If(Only({<SetAnalysis4m2017Exp>}[Week_Commencing]) > vThisWeek, '<s3>', '<s1>')
2017Forecast
If(Only({<SetAnalysis4m2017ForecExp>}[Week_Commencing]) > vThisWeek, '<s3>', '<s1>')
How do you define vThisWeek? Seems like a variable to me
Hi Sunny,
Yes, it's a variable which is assigned in the Load Script, and in this case is 31/10/2016. I'm fairly certain that the way this variable is assigned is not the problem, as when only one of my expressions is conditionally shown, Week_Commencing (field in my main data table) evaluates against it and gives the expected result (ie a dashed line for all dates after this date).
Cheers,
Dan
Another quick question.... You mentioned when two years are selected you see this issue. What happens when no year is selected? all the years are available for viewing?
Hi Sunny,
When no years are selected, nothing at all is displayed on the chart (other than the message "all expressions disabled"). This is the intended and expected behaviour - each expression being conditional on its year being selected, no expression will be displayed when no years are selected.
Can you do this
1) Create a copy of your chart
2) remove any show conditions
3) convert this into a straight table
4) create two new expressions
[Week_Commencing] and
vThisWeek
5) see how these two expression behave based on your selection in year. Does one of the two expression become null when you select 2 years?
Yes, Week_Commencing becomes null when >1 year is selected. I think you might be onto something here. Any further advice/solutions? Many Thanks for your help so far
Create another expression:
Concat(DISTINT [Week_Commencing], ', ')
Does it show up with multiple values? or is it still null?
It now shows up with multiple values, yes.
Can you share what those values are? Even better if you can post a screenshot