Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
ilanbaruch
Contributor III

period compare

hi all,

i'm trying to compare between two periods in the same strait table,

user selection based on a floating field (numeric date field with alias) .

expression based on a variable that holds user selection

vYearMonth=GetFieldSelections(RangeYearMonth)

tried it with:

sum( {$<yearmonth = {'=$(vYearMonth)'} , Year=,Month =  > } Amount)

and

Sum({<Year=, Month=, yearmonth = {"=$(=vYearMonth)"}>}Amount)

and

sum({<Year=, Month=, yearmonth={"$(vYearMonth)"}>}Amount)

but..

non of them work


any ideas?

advanced thanks

1 Solution

Accepted Solutions

Re: period compare

Do you have single selection or multiple selections in RangeYearMonth? May be try this

Sum({$<yearmonth = P(RangeYearMonth), Year, Month>} Charge)

View solution in original post

3 Replies

Re: period compare

Do you have single selection or multiple selections in RangeYearMonth? May be try this

Sum({$<yearmonth = P(RangeYearMonth), Year, Month>} Charge)

View solution in original post

krishna_2644
Valued Contributor III

Re: period compare

try - sum( {$<yearmonth = {"=$(vYearMonth)"} , Year=,Month =  > } Amount) - this works only for 1 selected value.


In variable overview -->

vYearMonth

GetFieldSelections(RangeYearMonth)  (dont put equal sign here)


if there are multiple selections, this doest work.



ilanbaruch
Contributor III

Re: period compare

worked for both, thank you