Group by "original order" causes looping in crystal report 11 - crystal-reports

I have a report grouped by Themes-S >> Questions-S there are 8 themes and each theme has a between 17 and 5 questions in it.
The report has 16 pages.
I need to change the ordering from specific to original when I do I end up with 288 pages
Something is looping? I can not figure out how to fix this
(using CR 11)

You just might have a very unoptimized original order, with page break properties set on start/end of group. For example, if your database stores records for 'country' in this order:
Canada
Canada
USA
Canada
USA
Canada
USA
Then with specific order "USA", "Canada", you'd have only 2 groups. With original order, however, you'd have 6 groups. Since the group is changing on (almost) every record, it might seem like it's "looping" over the values, repeating them again.
If you don't want it to do this, you can either (a) not use original order, or (b) change your source data to be better organized.

Related

I need help in data sanitization problem in tableau

I trying doing the manual sanitization, however I am getting a type mismatch error in performing the calculations.
I also need help in sanitizing the data and getting the insight as per the below instructions:
The column sellerproductcount gives you the count of products in the
form '1-16 of over 100,000 results' , and you can parse out the product count 100,000.
sellerratings - this columns gives you the % and count of positive ratings (e.g. 88% positive
in the last 12 months (118 ratings) ) if parsed correctly
sellerdetails - you can use this text to parse out phone numbers, and email IDs of
merchants, where available, so our team can reach out to them.
businessaddress - this will give you the business locations of the sellers. You can parse them
to identify if a seller is registered in the US , Germany (DE), or China (CN).
Hero Product 1 #ratings and Hero Product 2 #ratings - these 2 columns give you the number of
ratings of the 2 'hero products' or bestselling products of this seller.
I have attached the dataset for the same.
https://docs.google.com/spreadsheets/d/1PSqRCnmFgq7v7RzZaCXXoV0Edp_vM7QO/edit?usp=sharing&ouid=115547990006782902200&rtpof=true&sd=true
Most of this type of data prep can be done with string & RegEx functions like REGEX_MATCH(). Here are a few examples based on the data you shared:
Seller Product Count
INT(REGEXP_EXTRACT([Sellerproductcount], '(\d*,?\d*) results'))
1-16 of over 6,000 results >> 6000
Seller Rating (Percentage)
INT(REGEXP_EXTRACT([Sellerratings], '(\d*)% positive'))
92% positive in the last 12 months (181 ratings) >> 92
Seller Rating (Count)
INT(REGEXP_EXTRACT([Sellerratings], '(\d*) (?:total )?ratings'))
92% positive in the last 12 months (181 ratings) >> 181
Business Country Code
RIGHT([Businessaddress],2)
AM Treptower Park28-30Berlin12435DE >> DE
These examples all have very straightforward patterns that are present in all rows so they can be done pretty easily with one simple calculation. However, something like sellerdetails which is unstructured, inconsistent, and sometimes incomplete will be a bit more of a challenge. You will need to use a couple of different calculations and techniques combined together to find what you are looking for, as well as some manual data prep. Here's an example of how you can pull out email but it won't work for everything:
Email
REGEXP_EXTRACT([Sellerdetails], '([a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+#[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*)')
Good luck with your data cleaning, I suggest using sites like https://regex101.com/ and https://regexr.com/ to learn more about and help test regular expressions.

Aggregating logs label’s values in one line

I’m trying to create a table with an aggregation of values in the same field but without any calculation function.
I have a Loki LogQL query that transforms to a table with three labels. I want to do a “group by” with two of the labels, and the third one will be aggregated to have all the values in the same line together. For example:
The logs line from the query are:
Apple Buy 20
Apple Buy 20
Apple Sell 45
Apple Sell 45
Banana Buy 30
Banana Buy 30
Banana Buy 20
Banana Buy 20
Banana Sell 45
Banana Sell 45
And after transformations (Labels to fields, Filter by name, Group by - on all three labels, Organize fields), the table looks like this:
Table first example
I couldn't add a picture yet
And I want it to become like this:
Table after wanted change
So for Type Banana with Process Buy, all the values are aggregated together like in a list or vector (We can have the values ordered, but it’s not necessary, the Value is a string of a number).
I have been trying to do the change between the first table to the second and have encountered difficulties completing this change.
Any help would be very appreciated.
I have posted this also if the Grafana community and asking this here as well in the hope of a wider reach and finding an answer.

Combining duplicate rows in Crystal Reports

I posted this question already on another forum, but have not got any responses yet and requiring a solution quickly: https://answers.sap.com/questions/384242/combining-duplicate-lines-in-crystal.html
For various reasons to do with product numbering customization on our SAP B1 system, we can have no more than two of our standard items on a row in a sales order or invoice. All other items, such as accessories and non-numbered items we can put as many on a row as we want. To save any questions, this process cannot be avoided.
The issue is that this means we get some very strange looking invoices. For example if I sell 15 of our standard item 'A' and 15 of our standard item 'B' with 30 accessories to match, I can either bill out 15 lines each containing one 'A' and 15 lines each containing one 'B' then one line containing all the 30 accessories. Otherwise, I can bill out 7 lines each containing two of 'A', then one line containing the 15th A, then 7 lines each containing two of 'B', then one line containing the 15th B, and finally one line containing 30 accessories.
Is there any way that, in the case that an invoice contains rows with identical length, width, height and colour (or any other fields if it makes it easier), crystal can be configured to combine the rows into one and return the sum of the quantities and the sum of the prices in the relevant columns?
Added images below:

How to select a specific record/row of data in Crystal Reports?

I have my sql database Views available to my report, but sometimes they return multiple values, for example I have one that shows me the Total Credits for a range of years.
When I click "Browse Data.." it lets me see what bits of data are available
Eg:
Credits
-------
31
45
460
But I want to select 45 (based on a customer ID)... is it possible to do this?
EDIT: An alternative is if I can link the Customer ID from two views, but only if it's not null (as sometimes there are no records in the Credits)
To avoid the problem of unintentionally "deleting" customers from the report results, first do a left outer join between the CONTRACT_VIEW and the year views, such as TOTAL_2013. In your selection formula, instead of just doing something like {TOTAL_2013.Customer_ID}=MyCustomerID, add all the nulls to it as well, so: isnull({TOTAL_2013.Customer_ID}) or {TOTAL_2013.Customer_ID}=MyCustomerID. This will prevent customers who don't have any entries in the by-year views from being removed completely from the report.

Summarizing each subgroup in Group Footer - Crystal Reports

I'm trying to work on a report for a client. Basically I need something like such
Group 1: Customer ID
Group 2: Truck ID
CustID Vehicle ID Detention Time
------ ---------- --------------
ABX 100 60
35
20
TOTAL: 115
200 80
15
TOTAL: 95
300 10
TOTAL: 10
TOTALS FOR CUSTOMER ABX
100 115
200 95
300 10
Is there anyway to accomplish this without a subreport? I was hoping for a "summary field" that I could summarize more than just a single value.
Thanks!
(FYI using Crystal Reports 2008)
Use a crosstab; place it in the report-footer section.
There might be a better way to do this, but the one that comes to mind is to use two arrays: One to store the truck ID and another to store the corresponding total. In each inner grouping (TruckID), just tack on another array element and store its total time. To display, you could cast the values to strings, attach a newline character after each entry, and set the field to "Can Grow". So altogether, you'd need three formulas: one to initialize the arrays (in GH1), one to update the arrays with sum({truck.time},{truck.ID}) (in GF2), and one to display each entry (in GF1).
With that being said, CR has terrible support for containers... You're limited to 1-dimensional, non-dynamic arrays that are gimped at 1000 items max. It doesn't sound like these would be big problems for what you're trying to do, but you will need to redim preserve the arrays unless you know ahead of time how many trucks you'll have per customer.