Jump to content

How to show dates until current date in the xaxis of a line chart although data is available till Dec 2017


Recommended Posts

Hi All,

I the below line chart for current filter selection the max date is Dec 2017 

y-axis expression  = UniqueCount(If([DATE.]<=DateTimeNow(),[Val])) OVER (AllPrevious([Axis.X]))

X-axis =  <BinByDateTime([DATE.],"Year.Quarter.Month",2)>

Requirement is to display date in x-axis until 30-JUN-2024 and the data points should also be generated until 30-JUN-2024, but the value should remain 73.

image.png.fc8adb77be626f134a8bef3d6553ed98.png

Is this possible to achieve in Spotfire?

Link to comment
Share on other sites

Hi Prateek
Spotfire displays existing values on the x-axis.
Fortunately, Spotfires allows a combination of several data sources in a single report

To do this you need to have a data source with the dates needed for your chart

Then, you can either use the columns matches as shown below 👇

  image.thumb.png.6461db99330b0d1169c682ec900207e9.png

 

or combine the two tables into a single via the data canvas like this 👇

image.thumb.png.96da820ef66529ea6e77aeb5b7116fce.png

Note the "Right outer join" but the "full outer join" will also work

image.thumb.png.526b6e0857d2778c3c35d1f39df643ca.png

 

Then you create a filter to show only the date until today

e.g. filter current date.   :::::  [Date]<=DateTimeNow()

image.png.31e3de25a2c938ca3e705943b92cd790.png

 

an example result below 👇

image.thumb.png.df8393e16ea61384b20fefd28bb554ca.png

 

Find attached an example of both approaches 

data - missing dates.dxp

I hope this helps

 

Edited by Olivier Keugue Tadaa
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...