Crystal reports -Custom grouping - crystal-reports

I have a table called Employee(EmployeeNo,name,Address).Employee number is integer. Employee numbers
prefix is changes according to employees working location. for example
EmployeeNumber - Location
12323 - London prefix "1" says that employee location is in London
24343 - Newyork prefix "2" says that employee location is in Newyork
38989 - Moscow prefix "3" says that employee location is in Moscow.
Now my problem is I don't have separate field to group employee by there location in crystal reports. so I have to get each employee's location using his employee number and group it according to that.
example
London
12323 Thomas sx
13434 Ray xx
14343 Frank uy
NewYork
24545 Alan oo
26656 Robin op
29098 Hayden lp
Moskow
35424 gustov lo
38967 Levshev ol
any idea is appreciated..

Here compulsory scenario should be "Prefix" should be first letter of the location
Use the below code in a formula
Left (<database field>,1 )
Now use the formula to group.
You should be able to group according to lcoation

Related

IReport - multiple grouping

I need group data by 5 fields. It's ok, but I need show "Totals" in a new page after each first grouping.
Example:
Birth Nationally Car Job Name Money
1980 North American BMW Doctor Paul $1200,0
1980 North American BMW Lawyer Longman $2700,0
1980 North American Mercedes Nurse Lenna $4200,0
1980 Canadian Mercedes Police John $1300,0
1993 Italian Ferrari Pilot Marco $1500,0
I build my report in this way:
- Main report contain a subreport;
- Subreport (where the groups are):
Birth group header
Nationally group header
Car group header
et...
Car group footer
Nationally group footer
Birth group footer (here I put a SECOND SUBREPORT, that need be in a new page)
Second Subreport: contains the totals by birth, nationally and car, but only actual birth. After each Birth, I need show the sum of money. So, after 1980 would be shown:
1980
Nationally: North American Car: BMW Total: $3.900
Nationally: North American Car: Mercedes Total: $4.200
In a first moment, my subreport 2 didnt work because has no data. So I copied the original data for each object (list X that contains list X). So the subreport 1 uses list X e and pass list X to subreport 2.
But I don't know how to filter the Birth in subreport 2.
Is my solution correct? If yes, how to solve the problem of subreport 2. If no, how should I build that?
Thanks in advance.

Tableau Username() function to filter Revenue data by SalesRep

How do I filter the Sales Revenue by SalesRep so that each SalesRep should be able to see only the sales volume generated by them using the username() function.
Let's assume John generated $2000 revenue, Jena generated $3000 and Eric generated $5000. Total sales volume combined for all 3 SalesRep is $10000. Employee ID of John is 101, Eric is 102, Jena is 103. I'm the manager and my employee ID is 104. I want to use the username() function in Tableau to filter the data in a such a way that John should see only revenue generated by him i.e. $2000 and he should be able to see the revenue generated by Jena in the bar chart. Similarly, Eric and Jena should be able to check their respective sales revenue. However, I should have the access to the revenue of all 3 as I'm their manager. How do I implement it in Tableau using the USERNAME() function.
One possible solution could be with the help of ISUSERNAME():
Let's say SalesRep is an existing dimension in the datasource which has sales representative's full name or username or empid (Note: In below illustration I am considering that it has username e.g. John, Eric etc. For other options refer here).
Create a calculated field SalesUsersList as below (here list down ALL
members entry):
IF ISUSERNAME("John_Tableu_Username") THEN "John"
ELSEIF ISUSERNAME("Eric_Tableu_Username") THEN "Eric"
ELSEIF ISUSERNAME("Jena_Tableu_Username") THEN "Jena"
ELSEIF ISUSERNAME("Manager_Tableu_Username") THEN "Manager_Username"
END
Create a calculated field LimitedAccessUsers as below (here list
down ALL sales team's members entry who will have limited access):
([SalesUsersList]="John") or ([SalesUsersList]="Eric") or ([SalesUsersList]="Jena")
Create a calculated field hasLimitedAccess as below. Drag it to
'Filters' section and select True
NOT[LimitedAccessUsers] OR ([SalesUsersList]=[SalesRep])
Don't forget to let us know in case it solved your problem :)

Filemaker find latest record grouped by name in layout

I have a table of records with two fields: City and ImportDate
Example records:
London - 13/06/2016
Paris - 14/06/2016
Paris - 15/06/2016
London - 19/06/2016
London - 20/06/2016
New York - 13/06/2016
New York - 17/06/2016
I need to have a Filemaker layout where I display only the most recent entry for each city, so we know what imports to concentrate on as we can look down the list and see what is the oldest. In other words I want to group by City, and then display only the most recent date.
So, my layout with the above data would show:
London - 20/06/2016
New York - 17/06/2016
Paris - 15/06/2016
What's the best way to accomplish this?
Thanks.
Use a layout in list view with a sub-summary part (when sorted by City) and no body part. When asked, set the sub-summary part to print below the records it summarizes. Place the two fields in this part.
Sort your records by City and by ImportDate (ascending).

Distinct count not giving expected result

I have fields for customer names, customer account numbers, date of previous orders, and order values. I want an alert to show which customers have ordered at least three times over the reporting period. We can have more than one invoice for a given delivery. The main report looks like:
Account Number Acct Name Order Date Order Total
1001 Fred Smith 1/2/2016 £1.06
1001 Fred Smith 1/2/2016 £2.34
1001 Fred Smith 8/2/2016 £5.42
2001 Aled Jones 1/2/2016 £2.90
2001 Aled Jones 8/2/2016 £3.45
I've tried concatenating the account number and order date in a column via function and running an alert based on its distinct count. (After converting the date to a string.) But it still doesn't generate a list of distinct items.
What I currently have in the final column is a function that concatenates the date and account number to give a unique field with {ORDR.CardCode} + Cstr({ORDR.DocDate}) - Which returns:
1001 1/2/2016
1001 1/2/2016
1001 8/2/2016
2001 1/2/2016
2001 8/2/2016
I want to generate alert based on this field via the distinct count function and a report of any customer who ordered at least twice in the report period.
DistinctCount ({#Concat code and date}) >2
Even after this I still don't get what I need. How can I get a list of every customer who has ordered in the report period for at least two times?
You have travelled half way... to achive continue from here.
USe the created formula {ORDR.CardCode} + Cstr({ORDR.DocDate}) to create a group.
place same formula in details and take count of the records in group footer
Now create a alert on group footer summation to get the desired result
Edit........
Since you need customer then add customer in concat fornula and then create group.
acctnamr+{ORDR.CardCode} + Cstr({ORDR.DocDate})
Now place the customer name in group header and follow process as explained above

Crystal Reports XI Cross tab summarised field how to stop cell rows of the same value merging?

I have created a cross tab however if I have a firstname field it merges the rows together if there are two names which are the same. How do you get it to display the names in the each row. In the example below Sarah is not displayed twice as the cells are merged together.
Firstname Lastname
Judy Collins
Sarah Dane
Smith
Joe Dine
Mary Lane
It sounds like you grouped your crosstab on the first name only. I would recommend:
Make a new Formula (Call it "FullName")
In the formula, combine the first name and last name, e.g. something like {First Name}&{Last Name}
Edit your crosstab to group by the FullName formula instead.
Does this help?
EDIT
Based on your comment, I don't think your comment is with Crystal. You need a "unique ID" of some sort, a distinct number for each person. My original suggestion was trying to use the user's full name as a unique ID, but that won't work if your dataset is big enough to include multiple people with the same name. Does your dataset have any kind of unique ID? What is this crosstab trying to display? There might be a better way.