Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

automate the chart to show THIS months date

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

6 Replies
kamal_sanguri
Specialist
Specialist

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.

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
josephinetedesc
Creator III
Creator III
Author

Hi All

so what I want is that instead of the daily - appearing like this - I want it to default to THIS Month.

Jo

fred.PNG

kamal_sanguri
Specialist
Specialist

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.


josephinetedesc
Creator III
Creator III
Author

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)



Capture2.JPG

josephinetedesc
Creator III
Creator III
Author

I could not get this to work!