Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

abhaysingh
Valued Contributor II

Set Analysis Help

Hi All,

Need Below Logic in set analysis..

(if(Duty_Free_Flag = 'Y',(sum(Land_Cost +ActLand_Cost)*sum(Quantity)), if(Duty_Free_Flag = 'N',(sum((Land_Cost +[Stock Landed Cost])*(Quantity))))) + (sum(Quantity * Land_Cost)+sum(Tot_Duty))) - sum(Tot_Duty)

Kindly suggest

6 Replies
neetha_p
Honored Contributor

Re: Set Analysis Help

hi abhay,

may be try :

if(Duty_Free_Flag = 'Y',((sum(Land_Cost) + sum(ActLand_Cost))*sum(Quantity)) + ((sum(Quantity) * sum(Land_Cost)+ sum(Tot_Duty)) - sum(Tot_Duty)),

if(Duty_Free_Flag = 'N',((sum(Land_Cost) + sum([Stock Landed Cost]))* sum(Quantity)) + ((sum(Quantity) * sum(Land_Cost)+ sum(Tot_Duty)) - sum(Tot_Duty))))

MVP
MVP

Re: Set Analysis Help

This is a logic branch. Set analysis is for  filtering, not for branching the expression. You have no filters in the expression.

Set analysis is not 42*.

*See Hitchhikers Guide to the Galaxy

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
abhaysingh
Valued Contributor II

Re: Set Analysis Help

Actually I need total Amount After this Expression, but when I am using it not getting Final Amount as total.

MVP
MVP

Re: Set Analysis Help

I am not saying your expression is correct, I am saying that set analysis is not the answer.

Have you checked your parentheses?

Post your qvw or a representative sample with the value you expect from the expression for more detailed help.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

Re: Set Analysis Help

try pick & match instead of If

=(pick(match(Duty_Free_Flag,'Y','N'),

sum(Land_Cost +ActLand_Cost)*sum(Quantity),

sum((Land_Cost +[Stock Landed Cost])*(Quantity)))

+ (sum(Quantity * Land_Cost)+sum(Tot_Duty))) - sum(Tot_Duty)

abhaysingh
Valued Contributor II

Re: Set Analysis Help

Thanks For revert but I am not getting Total for the same, I don't want to select any field to get result..