Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to create a List Box with few cities and I need to filter the cities that are not in Europe.
I have Longitude and Latitude for every city.
I have tried to use "If" like this:
=If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,1,0)
Obviously it did not work. can someone please help?
you can try this expression in listbox.
=If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,'Europe','Others')
But instead of doing like this, you can do it in the script itself. Like
LOAD *,If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,'Europe','Others') as Region;
LOAD * INLINE [
P_Latitude, P_Longitude, Plant_ID, PlantName
-6.181015, 106.828335, 4, Jakarta
35.680071, 139.768522, 2, Tokyo
40.713054, -74.007228, 3, New York
51.507276, -0.12766, 6, London
52.374733, 4.898117, 1, Amsterdam
55.751615, 37.618701, 5, Moscow
];
Then simply create the 'Region' Listbox.
Is this something you are thinking of doing on the front end of the script or back end?
May be like this on the front end:
Aggr(Only({1<Country ={'*'}-{'Europe'}>} City), City)
First, thank you for you answer.
I did not understand it quite well, I am very new with this.
Let me write it again:
I have this table in Excel-
P_Latitude | P_Longitude | Plant_ID | PlantName |
-6.181015 | 106.828335 | 4 | Jakarta |
35.680071 | 139.768522 | 2 | Tokyo |
40.713054 | -74.007228 | 3 | New York |
51.507276 | -0.12766 | 6 | London |
52.374733 | 4.898117 | 1 | Amsterdam |
55.751615 | 37.618701 | 5 | Moscow |
And I need to create a chart only the cities in Europe.
You only have Longitude and Latitude? Don't have a field which explicitly states the name of the Country? Are you trying the if statement in the script to create flags?
you can try this expression in listbox.
=If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,'Europe','Others')
But instead of doing like this, you can do it in the script itself. Like
LOAD *,If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,'Europe','Others') as Region;
LOAD * INLINE [
P_Latitude, P_Longitude, Plant_ID, PlantName
-6.181015, 106.828335, 4, Jakarta
35.680071, 139.768522, 2, Tokyo
40.713054, -74.007228, 3, New York
51.507276, -0.12766, 6, London
52.374733, 4.898117, 1, Amsterdam
55.751615, 37.618701, 5, Moscow
];
Then simply create the 'Region' Listbox.
I do not know what flag is.
but I am trying to show in a List Box only the rows that mach the If condition.
Does this look like what you want?
I created a flag in the script:
Table:
LOAD *,
If(P_Longitude<=60 and P_Longitude>=11 and P_Latitude<=71 and P_Latitude>=36,1,0) as Flag;
LOAD * INLINE [
P_Latitude, P_Longitude, Plant_ID, PlantName
-6.181015, 106.828335, 4, Jakarta
35.680071, 139.768522, 2, Tokyo
40.713054, -74.007228, 3, New York
51.507276, -0.12766, 6, London
52.374733, 4.898117, 1, Amsterdam
55.751615, 37.618701, 5, Moscow
];
And then used the following expressions for the two list boxes:
1) =Aggr(Only({1<Flag = {1}>} PlantName), PlantName)
2) =Aggr(Only({1<Flag = {0}>} PlantName), PlantName)
Thank you all for you help!!!!!!!!!