krishnan krishnan Posted October 7, 2017 Share Posted October 7, 2017 i have to write a case statement to change x-axis from binbydatetime to fiscalbinbydatetime when i change dropdown. can anyone help me out real quick Link to comment Share on other sites More sharing options...
Khushboo Rabadia Posted October 9, 2017 Share Posted October 9, 2017 Writing case statement in x-axis for binned columns will end up concatenating the values like2015.Q1.Mar so we have following other ways to achieve it. One value to achieve this is through setting values in document property: You can create a dropdown list document property with Fixed values or Expressions containing values likeBinByDateTime([date],"Year.Quarter.Month",2) and FiscalBinByDateTime([date],"Year.Quarter.Month",2). Then use this document property in this x-axis of visualization. So whenever you change the document property x-axis will also change according to the expression value present in dropdown list. Other way to achieve this is through setting values in document property using iron python script: Create a string document property say "Expr". then you can create a dropdown list document property with Fixed values. Insert a script to act on dropdown property change that will set "Expr" property value as BinByDateTime([date],"Year.Quarter.Month",2) or FiscalBinByDateTime([date],"Year.Quarter.Month",2)based on dropdown property selection. Use this "Expr" property in x-axis of visualization. Below is the Iron Python scripting API for reference. https://docs.tibco.com/pub/doc_remote/sfire_dev/area/doc/api/TIB_sfire-a... Link to comment Share on other sites More sharing options...
Ashwin Ramagiri Posted January 29, 2020 Share Posted January 29, 2020 I was trying to achieve the same solution via the same approach but landed in a bit of issue representing data the way user anticipated. When we use BinByDateTime([date],"Year.Quarter",2) in a calculated column, it takes away its grouping on the visualization. For Example, if i had Year.Quarter as a selection it displays bar chart as 2018.Q1, 2018.Q2 and so on instead of grouping all quarters of 2018 under one branch. Does anyone have a solution on how to achieve same formatting as we do binning at the Category Axis level when we display X-Axis using "Set from Property" functionality. Link to comment Share on other sites More sharing options...
Tyger Guzman 2 Posted January 29, 2020 Share Posted January 29, 2020 Use <Year([date]) nest Quarter([date]) > instead of a BinByDateTime to have visuals keep the sections. Link to comment Share on other sites More sharing options...
Ashwin Ramagiri Posted January 29, 2020 Share Posted January 29, 2020 Thanks @tyger0951. 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