Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Use of variable in aggr

Hi All,

Can we use variable to aggregate over that defined variable. ?

Ex , I have created a variable with name vDate. I want to write sum(aggr(sum(Sales),vDate))

Thanks,

Sailee

3 Replies
Not applicable

Re: Use of variable in aggr

Hi,

sum(aggr(sum(Sales),vDate))

here you can use variable but vDate must be a Filedname not a value.

like this

set vDate=Year

sum(aggr(sum(Sales),vDate))

vikasmahajan
Honored Contributor III

Re: Use of variable in aggr

your expression is wrong 

you can use like this

sum(aggr( (SUM({$< FiscalYear={$(=max(FiscalYear))},[Posting Date] = {'<=$(=Date(vDate))'}>}[Sales]) ))

Vikas

Re: Use of variable in aggr

Hi

Try like this

sum(aggr(sum(Sales), $(vDate)))

Hope vDate is the Field Name.

Community Browser