Iain Posted October 3 Share Posted October 3 I am currently making Spotfire where I am filtering my data using a dropdown list with fixed values, the fixed values are currently "All", "Option 1", "Option 2" and the one I am struggling to syntax correctly when filtering my data is option 3 which is "Option 1 & Option 2" where i am i going wrong? code below bold is the section i am struggling to syntax correctly And case when DocumentProperty("Model") = "ALL" THEN [Model]=[Model] WHEN DocumentProperty("Model") = "option 3" THEN [Model]= "option1" &"option2" ELSE [Model]= DocumentProperty("Model")END Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted October 3 Share Posted October 3 Hi Iain, For my understanding, you're trying to combine the option 1 and option 2 values, when the dropdown list is filtered to option 3? And you're struggling to get the combination of option 1 and option 2 into the fixed values of the dropdown list. Is that correct? If so, do you get an error message (you can't save the dropdown list property? Or does it display the value erroneously? Could you share perhaps your dxp file or some screenshots that makes your use case more clear? Because I can't figure out if you just need a concatenate function in the CASE statement (instead of "option 1"&"option2") or that you would need a different approach. Kind regards, David Link to comment Share on other sites More sharing options...
Iain Posted October 3 Author Share Posted October 3 (edited) Hi David i have a column called engine Model with "1litre", "2litre" and individual parts which i don't want to include, the dropdown works successfully and is passing a value correctly, but when i use the document property to filter my visualizations it does not filter correctly, this is my code, "ALL" works correctly, and also after else. the problem is implementing the middle part from the second WHEN to before ELSE Edited October 3 by Iain Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted October 4 Share Posted October 4 Hi Iain, What does your Document property holds as values (the values from the dropdown)? Are these: ALL, Engine and 'the other parts'? And what values does the [Engine Model] column hold? I assume 1litre and 2litre are different values. Is that correct? If so, I think the '&' between "1litre" & "2litre" will be the problem. You could try to concatenate them, into a single string: concatenate("1litre","2litre"). Kind regards, David Link to comment Share on other sites More sharing options...
Iain Posted October 4 Author Share Posted October 4 Hi David i have tried the concatenate as discussed and it is not giving any results, yes the values in the column are "1litre", "2Litre" and then individual items such as "200cc", "400cc"... therefore the dropdown i have got passed a value for "Engine", which i am then filtering in my visualizations shown in the picture attached previously ideally i the concatenate would work and the Engine selection in the dropdown would then pass the "Engine" document property filtering the visuals to only include entries with "1litre", "2litre". I'm assuming that concatenating this as concatenate("1litre","2litre") is then looking to filter for "1litre2litre" rather than "1litre" & "2litre" individually, thus no data is being filtered and the visuals blank at the moment. hope this provides a better explanation of my problem thanks iain Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted October 4 Share Posted October 4 Hi Iain, So, the individual values (1litre and 2litre) should be taken into account whenever the dropdown is filtered to Engine (according to the CASE statement). Would it be possible to share some screenshots that include the dropdown values and the table values? Kind regards, David Link to comment Share on other sites More sharing options...
Iain Posted October 4 Author Share Posted October 4 this is what I have got in the dropdown when the value "engine" is passed i use that within the visualization to try filter for the 1 and 2 litre from my previous screenshot this is my column structure, i am essentially wanting the 1 dropdown option that passes Engine to filter for the "1litre" and "2litre" only. Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted October 4 Share Posted October 4 Thanks Iain, I'll try to see if we can make it to work. David Link to comment Share on other sites More sharing options...
Iain Posted October 4 Author Share Posted October 4 Thanks David, much appriciated!! Link to comment Share on other sites More sharing options...
Solution David Boot-Olazabal Posted October 4 Solution Share Posted October 4 Hi Iain, I think I got it. I've created a simple data table, with 4 columns. I've added a dropdown list property, as per the below: Based upon the selection of the values of the drop down, a Filter column displays if it is true or not. The Filter column is the CASE statement. This is the view for the 1litre selection: Now, because I have altered your initial CASE statement, the view from the 1litre&2litre selection 'collects' both the 1litre and 2litre engines: And then you can tie the Filter column to your way of filtering out the data. The CASE statement I used to combine both 1litre and 2litre engines, is this one: case when DocumentProperty("EngineModel")="All" THEN [Engine Model]=[Engine Model] WHEN DocumentProperty("EngineModel")="1 litre" THEN [Engine Model]="1litre" WHEN DocumentProperty("EngineModel")="2 litre" THEN [Engine Model]="2litre" WHEN DocumentProperty("EngineModel")="Engine" THEN ([Engine Model]="1litre") or ([Engine Model]="2litre") ELSE [Engine Model]=DocumentProperty("EngineModel") END Kind regards, David Link to comment Share on other sites More sharing options...
Iain Posted October 4 Author Share Posted October 4 Thanks David, thats got it working now! thanks very much for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now