Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
gopinadhpindra
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
sunny_talwar

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

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

gopinadhpindra
Contributor II
Contributor II
Author

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
Contributor II
Contributor II
Author

Hi dilip,

That not an issue here,that exp working fine only

wade12
Partner
Partner

your issue may be here:

BusinessArea=P(BU)

gopinadhpindra
Contributor II
Contributor II
Author

I will check on this let you know

MarcoWedel

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
Contributor II
Contributor II
Author

No Marco.....