Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
n1ef5ng1
Creator
Creator

Urgent, if else

I have a column that stated Indonesia Region with another column to all countries including indonesia.

Indonesia - Brunei

Indonesia - Malaysia

Indonesia - China

Indonesia - Indonesia

Indonesia - Singapore

Indonesia - America

Qn is I need two set of formula to derive the data in a column value

One formula for Indonesia - to countries excluding Indonesia

Another formula for Indonesia to Indonesia

Is there any way i can do it?

20 Replies
n1ef5ng1
Creator
Creator
Author

whats is TMP? and what is 1,  2

Not applicable

Hi ,

     As you mentioned you needed to define 2 formulas under one Expression.

Just wanted to check what  is the Condition under which you wanted to fit these 2 formulas?.

Means is there is any dimension w.r.t that you want to use this expression.

Regards

Yusuf

sivarajs
Specialist II
Specialist II

Tmp is your field name and subfield is used to get the specific string

ex in your case

Indonesia - Indonesia

Indonesia - Malaysia

Indonesia - China

Indonesia - Indonesia

Indonesia - Singapore

each string has '-' as common subfield(fieldname,'-') will seperate each sun string like Indonesia,Singapore etc

1 represents string before your delimiter '-' and vice versa

n1ef5ng1
Creator
Creator
Author

qlikview.bmp

  As attached. This table ID -> TSHIP refers to From ID(Indonesia) to _______

As you can see 10 PH means from ID to PH, ID to TH etc etc

However when it comes to ID to ID, i need a different sum expression

These are my formulas to derive

From ID to others

=Sum({<

Status = {'TSHIP'}
,Unlocode_Place_Of_Loading = {'ID*'}
>} Sales)

From ID to ID

=Sum({<

Status = {'TSHIP'}
,Unlocode_Place_Of_Loading = {'ID*'}

,Unlocode_Place_Of_Discharge = {'ID*}
>} Sales)

Not applicable

If(Country='Indonesis - Indonesia','A','B') as CountryFlag

nw u gt 2 combinations in the countryflag column, one is Ind - Ind and Ind-OtherCountry

use it for ur calculations...

n1ef5ng1
Creator
Creator
Author

=if

(

Country_Code = 'ID',

Sum(Derived_Status = 'TSHIP' and Container_Class_Name = 'Laden' and Unlocode_Port_Of_Loading = 'ID*' and Unlocode_Port_Of_Discharge = 'ID*')

,Sum(Derived_Status = 'TSHIP' and Container_Class_Name = 'Laden' and Unlocode_Port_Of_Loading = 'ID*')

)

does this works? what i get is OUt of object memory

Not applicable

Hi,

    please try to use set analysis in the expression mentioned by you.

=if

(

Country_Code = 'ID',

Sum({<  Derived_Status = 'TSHIP' and Container_Class_Name = 'Laden' and Unlocode_Port_Of_Loading = 'ID*' and Unlocode_Port_Of_Discharge = 'ID*' >}Sales )

,Sum({<Derived_Status = 'TSHIP' and Container_Class_Name = 'Laden' and Unlocode_Port_Of_Loading = 'ID*')

>}Sales)

//Yusuf

n1ef5ng1
Creator
Creator
Author

Hi i tried your code but there is an error in set modifier expression,

>}TEU

} is the error

er_mohit
Master II
Master II

Try this

=if

(

Country_Code = 'ID',

Sum({<  Derived_Status = {'TSHIP'}* Container_Class_Name = {'Laden'} * Unlocode_Port_Of_Loading ={ 'ID*'} * Unlocode_Port_Of_Discharge = {'ID*' }>}Sales ),

Sum({<Derived_Status = {'TSHIP'} *Container_Class_Name = {'Laden'} * Unlocode_Port_Of_Loading = {'ID*'}

>}Sales)

hope it helps

n1ef5ng1
Creator
Creator
Author

tried your code but there is an error in set modifier expression, 

>}TEU

} is the error