Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Country_Departure | Country_Arrival | Flight | Passengers | Profit |
---|---|---|---|---|
Indonesia | Singapore | Eugene101 | 121 | 24123 |
Indonesia | Malaysia | Eugene102 | 131 | 22421 |
Indoensia | Indonesia | Eugene103 | 222 | 929292 |
Indoensia | USA | Eugene101 | 944 | 75285632 |
Indoensia | China | Eugene104 | 111 | 1121 |
Hi gurus,
I have this pivot table where user can select any country in the world ie, country_arrival
On the above table, there is this pattern where Indonesia --> Country exclude Indoensia
and
Indoensia to Indonesia
I need two different expression to exprees the value of this two patterns
Therefore, if user select Indonesia, Formula A for Country exclude Indonesia , else Formula B for Indonesia to Indonesia.
Formula A: =sum( if( only(Country_Departure) <> Country_Arrival and not isnull(only(Country_Departure)) , Passengers)
Formula B: =sum( if( only(Country_Departure) = Country_Arrival, Passengers)
Are Indonesia and Indoensia different countries? Or just a typing error?
Maybe something like this is what you want:
if(Country_Departure='Indoensia' and Country_Arrival='Indonesia', expression1, expression2)
is there any way I can combine this two formula into one expression?
is a typing error.
As my country departure is determine by the user who are able to choose the country
Yes: =sum( Passengers )
The two expressions exclude each other. One is international flights, the other represent internal flights. Toghether represent all the flights.
Explain what you want to do.
Hi Lucian,
Your formula A and B makes sense,
I need the two formula that you express to be in one expression though, not looking for total flights.
is there any if else statemnt that I can use to have formula A and B in one expression
Yes, you can use:
=if( Flag = 1, FormulaA, FormulaB )
= FormulaA * Flag1 + FormulaB * FlagB
or other combinations. It depends on the context, where you want to include it (Text Object, Chart, ...).
Best provide a sample document which shows the context.