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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
sparur
Specialist II
Specialist II

Calendar with non-standard periods. How calculate a previous period using SetAnalysis

Hello, all.

I have a some problems with my non-standard Calendar table. Our company works with own Periods.1 Period it's a 4 week. There are 13 periods in one year/ for example: 2010P01, 2010P02, .., 2010P13

I have a source table with this non-standard calendar. This table has such fields:
FieldName, FieldValue
YearPeriod Key, 2010P01
YearPeriod, 201001
Year, 2010
Period, 01
PeriodSequence, 1

Usually, for calculating different previous standard periods (for example, Month) I use standard approach:
sum({<Month = {$(=Only(Month)-1)}>} SalesAmount)

It's work because each month has two data types (string and num - Dual data type).

In my situation I can't to use this approach.
Now, for calculating current value for YearPeriod and PrevYearPeriod I use two variables:
vCYP = Max(YEAR) & 'P' & Right(max(YearPeriod), 2)
vPYP =FieldValue('YearPeriod Key', FieldIndex('YearPeriod Key', vCYP)-1)


it's work in my developer client, but when I implemented it on QV Server - it doesn't work (in IE Plugin Client), because my second variable vPYP not calculated.
I have two questions, at least:
1) why my variable is not calculated on the server
2) How I can calculate prev periods with my non-standard calendar

I welcome any ideas...

4 Replies
sparur
Specialist II
Specialist II
Author

no ideas?Sad

Not applicable

On my QVS 9.0.7440. it works just fine.

sparur
Specialist II
Specialist II
Author

Hello, Nick.

What exactly do you say?

sparur
Specialist II
Specialist II
Author

I have QVS 8.50.6299.0409.10 and it didn't work 😞