Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Make an MonthCounter

Hello,

in my calendar do I have an 'InvoicePeriodCounter' and every month has two invoice periods.

Though I want to show current month -1 it doesn´t work over the year end.

How do I create the counter for the month over all years?

Example:

jan15    1

jan31    1

feb15    2

.

.

dec31  24

jan15   25

jan31   26

etc

Period_counter:
Load distinct
[Flag] as [Flag1],
[InvoiceYearMonth],
[InvoiceMonthNum] as [InvoiceMonthCounter],
recno() as [InvoicePeriodCounter]
resident tPeriod_counter
order by [Flag] asc;

kindly

Håkan

1 Solution

Accepted Solutions
daveamz
Partner - Creator III
Partner - Creator III

Hi Håkan,

You can transform YearMonth in MonthID using AutoNumber([InvoiceYearMonth]). Then you can use MonthID-1 regardless of year.

Best regards,

David

View solution in original post

6 Replies
israrkhan
Specialist II
Specialist II

i did not get you,

would you like to explain a bit more?

what is expected output?

Not applicable
Author

In the period_counter table do I expect a new column with a counter like the example below.

Not applicable
Author

oops! my Picture disappeared

Table1.png

daveamz
Partner - Creator III
Partner - Creator III

Hi Håkan,

You can transform YearMonth in MonthID using AutoNumber([InvoiceYearMonth]). Then you can use MonthID-1 regardless of year.

Best regards,

David

timanshu
Creator III
Creator III

Can you give a more clearer picture of  your doubt??

Do you want counter value to increment by one for each entry with in a month or you want counter value to remain same for multiple entries with in a month??

marcus_sommer

Maybe this is helpful: http://community.qlik.com/message/563904#563904

- Marcus