Kian Liong Tan Posted August 29, 2021 Share Posted August 29, 2021 FOr the table, we have information of the date, department and amount of expense. The information is from Jan-Jun How can I create a graph where I am able chart the difference between Q2 and Q1 expenses for each department. Formula would look like this Department 1: Apr + May + Jun - Jan -Feb -Marc (Department 1) Department 2:Apr + May + Jun - Jan -Feb -Marc (Department 2) Link to comment Share on other sites More sharing options...
Ajinkya Gutti Posted August 30, 2021 Share Posted August 30, 2021 You can create bar chart with the department in the category column. The Y-axis will have some numerical column. You can simple insert your formula in there to reflect the differences. Bar chart is a standard. You can also use pie chart if the number of departments is not many. Link to comment Share on other sites More sharing options...
Fabian Duerr Posted August 31, 2021 Share Posted August 31, 2021 Spotfire has very helpful aggregation methods available for you to do something like this. It will be very beneficial for you, when your month column is of type datetime. This will allow you to use the time hierarchy (year -> quarter -> month -> ..) on the X-axis. And this can also be used on the Y-axis in your aggregation. As you will see later, the Y-axis will adjust accordingly. So let's assume this dataset where I have a month column as a string. First I create a datetime coumn. Skip this step if your column already is of type datetime: ParseDate("2021-" & [Month] & "-01","yyyy-MMM-dd") Then I build different bar charts. On the X-Axis I have my datetime column with year/quarter/month. For the lower two charts I simply select a different aggregation method on the y-Axis.You can then move the position of the slider from month (center vis) to quarter (lower vis) to see how everything adjusts automatically. Isn't that beautiful ;) When you select the aggregation method, the custom expression will be generated for you. Check the Spotfire help to learn more about "Level" and "number of steps". Or play around with your data to explore these features. 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