Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have a chart with the x axis being the daily date. As I have years of data - this looks messy and some people do not like to "click".
Is there someway that the date can default to today's Month when a patient clicks on the daily chart???
I would prefer a simple way of doing this
Jo
yes, absolutely.. It is very simple.. you just have to replace the your current date field from your chart's dimension and use a calculated dimension instead of that.
=if(Month(Today())=Month(Date),Date(Date,'DD-MM-YYYY'),NULL())
Please refer the attached Qlikview Document.
That's OK if the data set is small, but may perform badly if you have millions of rows in your fact table. You also will be unable to select a different date for the chart/table. I would use a set expression of the form:
=Sum({<Date = {'$(=Date(Max(Date)))'}>} Amount)
This means use the most recent date if nothing is selected, or track the selection when the user selects a date.
Optionally - you can put the max date expression into a globally evaluated variable, like (in your load script):
Set vMaxDate = '=Date(Max(Date))';
And then use the slightly simpler:
=Sum({<Date = {'$(vMaxDate)'}>} Amount)
Adjust the expressions to suit your data model and requirements.
Hi All
so what I want is that instead of the daily - appearing like this - I want it to default to THIS Month.
Jo
As mentioned earlier, please try replacing your date field from dimension and replace with this one
=if(Month(Today())=Month(Date),Date(Date,'DD-MM-YYYY'),NULL())
Where Date is the Date field in your data.
this works:
=if(monthname(Today())=Monthname(thisDate),SUM(band1), sum(band1)) (etc for each band)
and make dimension1: =date(thisDate,'DD/MM/YYYY')
I could actually use:
=if(monthname(Today())=Monthname(thisDate),SUM(band1))) (etc for each band)
I could not get this to work!