Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

gopinadhpindra
New Contributor II

If condition with two set expressions

Hi Qlikexperts,

Below If condition  with multiple set expression is not displaying the value.

Scenario:

TerritoryDesc=Alpha -->it need to execute the First Set Expression ,or Else Statement.

IF Statement with multiple Set Expression:

if(TerritoryDesc='Alpha',sum({$<Version_Desc = {'Adjustment','Actual'},SalesType_Key={'1'},SalesPeriod = {1},Calendar_Half_Year_Eng={'Jul-Dec'},BusinessArea=P(BU),Calendar_Month = {'<=$(=max(Calendar_Month))'},Day_of_Week=,CP_Team_Flag = {'CP','ORG'},Product_Group_Code -= {'ENCG','ENTG'}>}Sales_Value)/1000,

sum({$<Version_Desc = {'Adjustment','Actual'},SalesType_Key={'1'},SalesPeriod = {1},Month={'*'},Calendar_Month = {'<=$(=max(Calendar_Month))'},Day_of_Week=,CP_Team_Flag = {'CP','ORG'},Product_Group_Code -= {'ENCG','ENTG'}>}Sales_Value)/1000)--->End of IF Statement


Even tried with Variable :

if(SAP_TerritoryDesc='Kottayam',Vsup,Vex)

stalwar1marcowedeldilipranjithsagupta2792maxgro

8 Replies

Re: If condition with two set expressions

Is this used in a chart where you have TerritoryDesc as dimension? Also, does this show anything if no selections are made?

Partner
Partner

Re: If condition with two set expressions

1 mistake detected. replace ' by " double quotes in date set analysis

Calendar_Month = {"<=$(=max(Calendar_Month))"}

single quotes are for literal matches i.e. equal to something definte

also is star a value below? if not same change

Month={'*'}

gopinadhpindra
New Contributor II

Re: If condition with two set expressions

Here we are using straight tablee month and product is the dimension,condition enabling also there

Actually I need Q3 onwards(July to dec) sales value make it as 0 because territory desc=alpha merze with some other territory so there is no salesvalue for July onwards

Vsup:variable

sum({$<Version_Desc = {'Adjustment','Actual'},SalesType_Key={'1'},SalesPeriod = {1},Month={'*'},Calendar_Month = {'<=$(=max(Calendar_Month))'},Day_of_Week=,CP_Team_Flag = {'CP','ORG'},Product_Group_Code -= {'ENCG','ENTG'}>}Sales_Value)/1000)


The above exp showing sales value for all months


Vex:variable


sum({$<Version_Desc = {'Adjustment','Actual'},SalesType_Key={'1'},SalesPeriod = {1},Calendar_Half_Year_Eng={'Jul-Dec'},BusinessArea=P(BU),Calendar_Month = {'<=$(=max(Calendar_Month))'},Day_of_Week=,CP_Team_Flag = {'CP','ORG'},Product_Group_Code -= {'ENCG','ENTG'}>}Sales_Value)/1000

The above exp limit the July to Dec sales value 0

if(TerritoryDesc='alpha',Vsup,Vex)



That what I need these both into  if condition

Any ideas or any other way to write the expression


Sunny plz help me on this


Thanks


gopinadhpindra
New Contributor II

Re: If condition with two set expressions

Hi dilip,

That not an issue here,that exp working fine only

Partner
Partner

Re: If condition with two set expressions

your issue may be here:

BusinessArea=P(BU)

gopinadhpindra
New Contributor II

Re: If condition with two set expressions

I will check on this let you know

Re: If condition with two set expressions

pin var wrote:

Here we are using straight tablee month and product is the dimension,condition enabling also there


Could there be more than one distinct value of TerritoryDesc per month/product combination?

gopinadhpindra
New Contributor II

Re: If condition with two set expressions

No Marco.....