Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sasukeindra
Contributor II
Contributor II

Create corresponding date field

I have a table with the following fields:

TimeTable
Period
PeriodID
Current

Period: Last 12 Months, Last 6months, YTD, QTD

PeriodID: YYMM

Current: Y/N (for example if the months are part of the last 12 months then Y otherwise the remaining 12 will be N).

The table were created using a mastercalendar table, where there a rownumber and the row 1 is associated to the last date

I was asked now to create an additional field, Associated Period


For example, for the Last 12 Months would look like this:

PeriodIDPeriodCurrentAssociated
1712Last12MonthsY1712
1612Last12MonthsN1712
1711Last12MonthsY1711
1611Last12MonthsN1711

I manage to create the values for the last 12 months, by only adding +100 when the rows less than 12. However I am finding hard to find the solution for the remaining periods.

Does anybody have any tips or done something similar before?

Hope I was clear enough...

Thank you!


1 Reply
sunny_talwar

What are the other periods?