JCL Sort to get selective records - sorting

I have one input file like below:
india
delhi
kolkata
chennai
orrisa
kerala
banglore
Now my requirement is my jcl search kolkata and write output file till orrisa.
so my output would be:
kolkata
chennai
orrisa

Related

Tableau - Filter Results Based on Name

I have a view with calibration data where hosts create a calibration session, provide scores, then open up the sessions for others to join and score and see how they compare.
Example of my data:
Date
SessionID
Participant Type
Name
Score
New Calculated Field
2022-04-01
250
Host
John Smith
A
John Smith
2022-04-02
250
Participant
Jane Doe
A
John Smith
2022-04-04
250
Participant
Ed Jones
B
John Smith
I'm trying to create a field in Tableau where users can filter to/select the Host's name and see the results of all participants for that SessionID. In the example above, they would select "John Smith" and see the data for John Smith, Jane Doe, and Ed Jones.
Based on research, I believe I need to use FIXED, but am not sure how to write that calculation. Any assistance would be appreciated!

Oracle BI EE filter on same dimension

I am new to OBIEE and would like to create an analysis where I can place one next to the other 2 columns with figures from same dimension but with different data.
To better explain it: let's say that in Dim1 we have Invoices and Payments as members. We also have other dims as Date, Invoice Number and so on. This would be the current output:
Date | Dim1 | Invoice Number | Amount
10/01/17 Invoice 1234 -450
10/02/17 Payment 1234 450
So, what I want is, instead of creating 2 reports, one for the Invoices and the other one for Payments, a single report with the following output:
Invoice Date | Invoice | Payment date | Payment | Invoice Number | Amount inv | Amount paid
10/01/17 Invoice 10/02/17 Payment 1234 -450 450
Is this kind of output achievable inside OBIEE?
Thanks!
You are not trying to "filter on same dimension" but you are trying to convert rows into columns.
While it is possible to cheat your way around this it is definitely not something which is suggested! You are facing an analytical system - not Excel.
If this is an actual requirement and not simply a "I wish to see it this way" then the best approach is to store the data properly.
Second-best approach is to model it in the RPD with different logical table sources.
Last and the option NOT to go for right away is what you are asking for: Doing it in the front-end.
Apart from that: It's "analyses" that you are working with in OBI. If you have a "report" then you are in BI Publisher which is a completely different tool.

How to handle scenario of same city with multiple names

Ok, I have a list with some contacts on it filled by respective persons. But persons living in same city might write different names of cities(that I don't have any control on sice the names of cities may change with changing government).
For example:
NAME CITY
John Banaglore
Amit Bengaluru
Here both the Bangalore and the Bengaluru refer to the same city. How can I make sure(my be programatically) that my system does not consider as two different cities but one, while traversing the list.
One solution I could think of is to have a notion of unique ids attached to each city, but that requires recreating the list and also I have to train the my contacts about the unique id notion.
Any thoughts are appreciated.
Please feel free to route this post to any other stackexchange.com site if you think it does not belong here or update the tags.
I would recommend creating a table alias_table which maps city aliases to a single common name:
+------------+-----------+
| city_alias | city_name |
+------------+-----------+
| Banaglore | Bangalore |
| Bengaluru | Bangalore |
| Bangalore | Bangalore |
| Mumbai | Bombay |
| Bombay | Bombay |
+------------+-----------+
When you want do any manipulation of the table in your OP, you can join the CITY column to the city_alias column above as follows:
SELECT *
FROM name_table nt INNER JOIN alias_table at
ON nt.CITY = at.city_alias
I think the best way is to provide selection from a list of existing Cities and do not allow to enter it by the user manually.
But if you have data already it is more reliable to use alias table proposed by #Tim Biegeleisen
In addition, some automation could be added, as an example, to check is it correct to ignore 2 words difference in a case when it is not first letter by put it on the aliases table with mark as candidate for future review.
Here is examples of reasons for exclusion of first letter:
Kiev = Kyiv
Lviv != Kiev

How to get country name based on ip

I have a list of IP address. I need to assign a country to each IP.
For example http://www.ip2nation.com/ provides this service.
I have found some databases for IP2Country, but how do I integrate it with pig?
Input:
14.59.63.28
145.89.87.211
54.27.253.89
98.201.50.22
116.48.29.143
145.89.87.211
20.109.204.65
20.109.204.65
Expected output:
14.59.63.28 country1
145.89.87.211 country2
54.27.253.89 country3
98.201.50.22 country4
116.48.29.143 country5
145.89.87.211 country2
20.109.204.65 country6
20.109.204.65 country6
You will need to get Extract of Database of IP and country name from that database.
Then use that Extracted data to perform join with your data which you streaming.
I will straight forward join. To get better performance you can check for replicated join in Pig
http://pig.apache.org/docs/r0.7.0/piglatin_ref1.html#Replicated+Joins

One-Many and One-One relationship using LINQ to SQL on Stored procedure

Lets say I had Three tables Customer(ID,Name),CustomerAddress(ID,Address1,Address2),Phone(ID,PhoneNumber). So in this,Each Customer has Multiple Addresses(one-Many relation ship) and Each Address has one Phone (one-one relation ship). I had a stored procedure which returns all the data in below order
ID Name Address PhoneNumber
1001 John MD 1234
1001 John VA 1231
1001 John WA 1232
1002 Mary NJ 0231
1002 Mary NY 0232
1002 Mary OR 0032
Right now, after getting above data i am sitting in a for each loop and filling my data objects.But, I want fill those Data objects dynamically using LINQ-SQL. I saw this article which exactly does the same thing http://www.codeproject.com/KB/linq/OneManyandOneOneLINQ.aspx?fid=1543095&select=3878390&fr=1&df=90&mpp=25&noise=3&sort=Position&view=Quick.
The only difference is i am running stored procedure to get data.
So, Any one knows hoe to fill these entity classes w/ stored procedure?
Any input would be really help full.

Resources