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

Before Keyword in Qlikview

Hi Everyone,

I am new in Qlikview and to this forum also.Can Anyone explain me the usage of Before Keyword in Pivot table and a short example of this function. I am not able to use this function?

Please help me in this regard.

7 Replies
sparur
Specialist II
Specialist II

Hello, vikas.

Before it's analog of above function for pivot chart. see more details in built-in help:

before( [ total ] expression [ , offset [,n ]] )

Returns the value of expression evaluated with a pivot table's dimension values as they appear in the column before the current column within a row segment in the pivot table. This function returns NULL in all chart types except pivot tables.

On the first column of a row segment a NULL value will be returned, as there is no column before this one.

If the table is one-dimensional or if the expression is preceded by the total qualifier, the current row segment is always equal to the entire row.

If the pivot table has multiple horizontal dimensions, the current row segment will include only columns with the same values as the current column in all dimension rows except for the row showing the last horizontal dimension of the inter field sort order.

The inter field sort order for horizontal dimensions in pivot tables is defined simply by the order of the dimensions from top to bottom.

Specifying an offset greater than 1 lets you move the evaluation of expression to columns further to the left of the current column. A negative offset number will actually make the before function equivalent to a after function with the corresponding positive offset number. Specifying an offset of 0 will evaluate the expression on the current column. Recursive calls will return NULL.

By specifying a third parameter n greater than 1, the function will return not one but a range of n values, one for each of n table columns counting to the left from the original cell. In this form, the function can be used as an argument to any of the special range functions.

Examples:

before( sum( Sales ))

before( sum( Sales ), 2 )

before( total sum( Sales ))

rangeavg (before(sum(x),1,3))

returns an average of the three results of the sum(x) function evaluated in the three columns immediately to the left of the current column.



Not applicable
Author

hi,

i have already read this from the reference manual.....can u give an example...i mean how to write in the expression of pivot table...

sparur
Specialist II
Specialist II

for example: if you have expression like this: sum(Sales)

so in column pivot table you should use before( sum( Sales )). See in my attachment



Not applicable
Author

thanks dear,

i have just found the result.....actually i was putting that dimension vertically.........

Not applicable
Author

Hi,

I attach an Example of my report.I don't know because the column Scheduled Period doesn't work..:-(

I should calculate the progress in a Period from two CutOff Date.in 'scheduled period' column.

I attach an example of my report.

Many thanks 🙂

Not applicable
Author

anyone know how to work around recursive calls?

I have a pivot that shows monthly and i have data for the first 2 months but i have a calculation for the succeeding months that use data from previous months.

Not applicable
Author

Did you already fix this problem?

Thanks in advance!