Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
bhaveshp90
Contributor III

How to do filter after filtering in the expression?

Hello,

I have a table with Region, Report_Parameters as the dimension and the expression is given below;

if

(

Report_Param = 'Gross Profit in % of Sales',

((Sum({< Report_Param = {'Gross Profit'}>}Value))

/

(Sum({< Report_Param = {'Sales'}>}Value))),

Sum(Value)

)

Logic: For all the Report Parameters the Values = Sum(Values) except for Gross Profit in % of Sales.

For Gross Profit in % of Sales, the value is Sum(Gross Profit)/Sum(Sales)

But the  Report Parameter = "Gross Profit in % of Sales" is filtering out from my table as shown below;


1.PNG

What wrong am I doing here?

thanks

Bhavesh

1 Solution

Accepted Solutions

Re: How to do filter after filtering in the expression?

Try this

If(Report_Param = 'Gross Profit in % of Sales',

((Sum(TOTAL <MonthField, BudgetForcastField> {< Report_Param = {'Gross Profit'}>}Value))

/

(Sum(TOTAL <MonthField, BudgetForcastField> {< Report_Param = {'Sales'}>}Value))),

Sum(Value)

)

Where MonthField and BudgetForcastField are the fields from your chart

Capture.PNG

2 Replies

Re: How to do filter after filtering in the expression?

Try this

If(Report_Param = 'Gross Profit in % of Sales',

((Sum(TOTAL <MonthField, BudgetForcastField> {< Report_Param = {'Gross Profit'}>}Value))

/

(Sum(TOTAL <MonthField, BudgetForcastField> {< Report_Param = {'Sales'}>}Value))),

Sum(Value)

)

Where MonthField and BudgetForcastField are the fields from your chart

Capture.PNG

bhaveshp90
Contributor III

Re: How to do filter after filtering in the expression?

Wow, it worked just like that. thank you Sunny for the solution