Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
martin_hamilton
Creator
Creator

Only show current month in line chart in qliksense

Hi

i only want to show the current months data in a line chart and have set a variable up but am struggling to create a set analysis to only show the current months data in the line chart.

The field name is [Session Month] and set as a Dimension

The variable is vCurrentMonth  =MonthName(Today())

In qlikview I would have just shown the last x largest values based on the Session Month

can someone help?

Many Thanks

Martin

6 Replies
martin_hamilton
Creator
Creator
Author

Sorry just to add to the above I am looking to restrict the view to the last month of data but show a count of sessions per day in a line graph.

I thought something like this would work but its not...

Dimension

=[Session Date]

Measure

count( distinct{$<[Session Month] ={"$(vCurrentMonth)"}>}Total SESSION_ID)

Thanks

Martin

tresesco
MVP
MVP

First, if it is last month , wouldn't your variable be like:

vCurrentMonth  =MonthName(Today() ,-1)


Then, make sure the output of variable and the month field [Session Month] values are of same format. That is, your variable output would probably (default) be like - 'Apr 2017' , hence the set would only work if the values in your field [Session Month] are of format MMM YYYY.

martin_hamilton
Creator
Creator
Author

Hi apologies it should have read current month therefore my variable is correct.

The formats of all columns related to month are correct as well e.g. MMM YYYY.

tresesco
MVP
MVP

Try to share your sample representative qvw.

martin_hamilton
Creator
Creator
Author

Hi - have attached a sample app.

I also have seen something strange in regards to the filter pane it is showing duplicate dates so am not sure that the script is set correctly as i would only expect distinct values to be shown??

tresesco
MVP
MVP

Try to truncate the timestamp values from date field like:

    Date(Floor(DATE_CREATED), 'DD/MM/YYYY') as [Session Date],

    MonthName(Floor(DATE_CREATED)) as [Session Month],