Kaivalya Deshmukh Posted November 4, 2015 Share Posted November 4, 2015 Hello Everybody! I'm trying to set X axis conditionally based on a property control (drop down) selection. My code in X axis custom expression goes this way : case when "${varLocation}"="Cities" then [Region] NEST [City] when "${varLocation}"="States" then [Region] NEST [states] when "${varLocation}"="Region" then [Region]end as [Location] but this code does not accept NESTing & throws an error saying "The expression is not valid after NEST on line 1..." I tried using If() also but no luck. Though, I can achieve this using python script, I want to minimize the script usage & limit to only those situations when there is no other option. Has anybody came across such issue Any help would be much appreciated! Thanks,KD Link to comment Share on other sites More sharing options...
Niko Maresco Posted November 4, 2015 Share Posted November 4, 2015 typically,NESTexpressions need to be surrounded by angle brackets like , however angle brackets are invalid syntax inside of any other statement (like CASE). I think your best solution will be to change your Property Control from Fixed values to Expressions and put the exact expression there instead. Link to comment Share on other sites More sharing options...
Santosh Krishnan Posted November 4, 2015 Share Posted November 4, 2015 @kavilya.deshmukh thanks for raising this; i was facing a similar problem but never got around to posting it here. @niko will try your method - it does makes sense! thanks again! Link to comment Share on other sites More sharing options...
Kaivalya Deshmukh Posted November 4, 2015 Author Share Posted November 4, 2015 Thank you niko for the solution, but unfortunately available columns for Expressions under Property Controls are from only default data table & I've multiple data tables in my dxp (& setting up current data table would not save me as I have to set up multiple property controls for different data table columns on different pages.) Could there be any workaround for this Link to comment Share on other sites More sharing options...
Firmin HENDRICK Posted October 23, 2017 Share Posted October 23, 2017 Hi all ! I need to relaunch this subject... I'd like to create something like that : If (1=1,,) to avoid (empty) line when B IS NULL following a filter update (no script possible on filter update). But "The expression if not valid after..." Is there a magical idea Many thanks, Link to comment Share on other sites More sharing options...
Grgori Gerebtzoff Posted January 14, 2019 Share Posted January 14, 2019 I just bumped into the same problem; The way I solved it was by replacing the NEST command with the Concatenate function: case when="${varLocation}"="Cities" then Concatenate([Region], ">>", [City]) when "${varLocation}"="States" then Concatenate([Region], ">>", [states]) when "${varLocation}"="Region" then [Region] end as [Location]> I added ">>" to make sure I would end up with unique concatenated values. (Don't forget to cast to String if you work with numerical fields) 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