Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
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
Highlighted

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

Highlighted
Partner
Partner

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={'*'}

Highlighted
Contributor II
Contributor II

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


Highlighted
Contributor II
Contributor II

Hi dilip,

That not an issue here,that exp working fine only

Highlighted
Partner
Partner

your issue may be here:

BusinessArea=P(BU)

Highlighted
Contributor II
Contributor II

I will check on this let you know

Highlighted

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?

Highlighted
Contributor II
Contributor II

No Marco.....