Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

count per period

In my load script i create a field named period with date(calenderdate,'YYYY-MM').

works fine

now i want a chart with number of invoices per period.

dimension : period

expression : =count(invoice)

In my chart sometimes a period is displayed twice with different results. Other periods are displayed once in that chart.

Cannot figure out why this happens. Should be a very simple chart.

4 Replies
robert_mika
Master III
Master III

Try:

Date(monthstart(calenderdate), 'YYYY-MM') as period,

Feeling Qlikngry?

How To /Missing Manual(24 articles)

sunny_talwar

Create a MonthYearField one of these ways to make it work:

MonthName(calendardate) as period

or

Date(MonthStart(calendardate), 'YYYY-MM') as period

curiousfellow
Specialist
Specialist
Author

Thank you both, it worked.

So Qlikview still remembers the original date, allthough i created a new field ?

Otherwise I do not understand why this happens

sunny_talwar

This happens because just because you formatted Date as YYYY-MM doesn't mean that date information is gone. It is still a date (02/05/2016) represented as 2016-02. So for each distinct date you see a different YYYY-MM. But MonthName and MonthStart helps you resolve this issue.