Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Set modifiers in to a variable

Hi

I am Creating a Dashboard for Profit & Loss. I have used the following code to access Period to date figure depend on the user selection.

It is working perfectly.

if (ValueList('Direct Income','Direct Expense','Gross Profit','Other Expense','Profit Before Other Income','Other Income','Net Profit')='Direct Income',

   sum({$<PeriodID={"<=$(=Max(PeriodID)-12)"},[Financial Year]={$(=Max([Financial Year])-101)},Period=,[Account Type]={'D'}>}$(eAccountBalance)),

I have tried to set up a variable for the PeriodID and Financial Year(User Selection) and cried to used it in the main expression as below but the variable vSetPTD initialization is giving me an error.

vSetPTD


PeriodID={"<=$(=Max(PeriodID)-12)"},[Financial Year]={$(=Max([Financial Year])-101)},Period=

**Main Expression

sum({$<$(vSetPTD),[Account Type]={'D'}>}$(eAccountBalance)),

Is their a way to overcome this issue.

Thank you.

Harsh

2 Replies
MVP
MVP

Re: Set modifiers in to a variable

While defining variable put the string within single quotes like:

vSetPTD

= 'PeriodID={"<=$(=Max(PeriodID)-12)"},[Financial Year]={$(=Max([Financial Year])-101)},Period='

MVP
MVP

Re: Set modifiers in to a variable

Hi,

Try like this

Variable :

vSetPTD (No = in the variable declaration)


PeriodID={"<=$(=Max(PeriodID)-12)"},[Financial Year]={$(=Max([Financial Year])-101)},Period=

Expression : = sum({$<$(vSetPTD),[Account Type]={'D'}>}$(eAccountBalance)),

Regards,

jagan.

Community Browser