Crystal Reports: Converting Selected Row Data to Column Data - crystal-reports

Is it possible to transpose data for a select column in Crystal? Here is my issue... I am using ttx file to get data fields for the Crystal Report...
I want only the tax_type and the tax_rate and tax amount to show up in the same row as the product sold. The tax_rate is stored in a separate table that needs to be pulled in as a column as well. I need to group and sum on product, buy, sell, tax_type, and then net the whole amount to come up with net total which I kinda know how... but I am stuck at transposing a row. Basically I only want to show row as column where tax type, amount, and rate matches transaction number and YN_tax == 1. The tax rate is stored in a totally separate table... Mind you that tax will not be applicable to each transaction... Here are the table Details
Details Table
Transaction Sales_Date buy_sell Product location ProductType price amount YN_tax tax_type
123456 11/9/2014 Sell DEF Brazil trinkets 5 703.08
123457 11/9/2014 Sell ABC Canada widget 10 213.5
123458 11/9/2014 Buy DEF Brazil trinkets 2 630
123459 11/9/2014 Buy DEF Brazil trinkets 3 34.41
123457 11/9/2014 Sell ABC Canada SalesTax 3 688.2 1 SalesTax
123458 11/9/2014 Buy DEF Brazil FederalTax 2 132 1 FedTax
Tax Rates Table
title rate
SalesTax 8.25
FedTax 9.75

You can do it follow below process.
Before proceeding link the table so that you get title and rate.
Create a formula for every column as you want in the report and write formula as below.
if YN_tax =1
then tax_type
Above formula is for column tax_type in the similar way create individual formulas for all columns.

Related

Grand total with each summation in crystall report

I have data like this
Type Buy Sell
Car1 23000 15000
Car2 24000
Car3 25000
I used sum(#buy) for total buy field and sum(#sell) for total sell field.
Can I sum all or grand total that like sum(#buy) + sum(#sell) ?
because when I run in VB6 for preview that report, Grand total not show on, please help me master.
For this there are 2 approach.
Via Formula :- add a formula field and in that add give above condition in formula field editor. put this field in your desired location, but ideally put in report footer or group footer(if any).
Use running total or summary total.
Check this links
Crystal Report Sum of a Column data
https://forums.asp.net/t/1971464.aspx?Sum+of+Total+in+Crystal+Report+

Crystal Report multiple static & dynamic columns using multiple timeframes

I have a report with multiple static columns relating to a customer, where I want to also list 3 separate items for different time periods for comparison in additional columns.  I am not sure if I should try to do it with formulas for those time periods.  I have tried to figure out crosstab reports, which seems straight forward on the surface, but cannot seem to accomplish what I want either.  Suggestions would be appreciated.
Static Information Report columns are:
Group  Branch  Agent #  ContactName  CompanyName (followed by the repeating columns for time periods   #FILES   INVOICETOTL   PAYMENTS  BAL)  These repeating columns would be monthly figures based on the invoice date which is not appearing in a column
EXAMPLE
GRP1  RP 1234  John James  Simplifle Co  5  $3000  $2000 $1000   7 $300 $200 $100 The 5 $3000 $2000 $1000 is the info for January
the 7 $300 $200 $100 is the info for February
Hope this is making some sense

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

How do I add multiple subtotals in tableau?

My report has the following structure
ID , Currency, Subdepartment, Unit , Revenue, Salary
I wanted to print the subtotals of Revenue and Salary for the following combinations
(ID, Currency, Subdepartment)
(ID, Currency, )
The row has discrete dimensions hence the default grandtotal/subtotal option is not working .
is thr an alternate to calculate the subtotals and display beneath each grouping.?
If you're hoping to see this in a single worksheet, it sounds like a job for LOD (level-of-detail) functions. I'm not sure how you want to visualize it, but here's how you could simply make a table.
Create some calculated fields:
Revenue Total (ID, Currency)
{ FIXED [Id], [Currency] : SUM([Revenue]) }
Salary Total (ID, Currency)
{ FIXED [Id], [Currency] : SUM([Salary]) }
We can then create a table (for example) with the subtotals and totals by placing the following pills in the Rows shelf, in this order:
[ID]
[Currency]
SUM([Revenue Total (ID, Currency)]) (Make it discrete)
SUM([Salary Total (ID, Currency)]) (Make it discrete)
[Subdepartment]
SUM([Revenue]) (Make it discrete)
SUM([Salary]) (Make it discrete)
The resulting table will look something like this:
ID Currency Total Revenue Total Salary Subdepartment Revenue Salary
----------------------------------------------------------------------------------
A Dollars $200 $100 R $140 $30
S $60 $70
Manat ₼4000 ₼8000 R ₼1000 ₼7000
S ₼3000 ₼1000
Yen ¥500 ¥1000 R ¥100 ¥300
S ¥200 ¥500
T ¥200 ¥200
B Dollars $300 $700 R $200 $600
S $100 $100
Manat ₼7000 ₼3000 R ₼2000 ₼1000
S ₼3000 ₼1000
T ₼2000 ₼1000
Yen ¥900 ¥400 R ¥150 ¥100
S ¥250 ¥100
T ¥300 ¥200
All that said, FirebladeDan makes a great point in the comments of your question. Tableau is NOT Excel – it's a visualization tool, and a smokin' one at that. If you want to show aggregations of measures at different levels of detail, your best option (both in terms of what Tableau can easily do and the clearest way to visualize it) is usually going to be to create a dashboard with multiple worksheets at different levels of detail and to take advantage of filter actions and other controls to see how it all relates.

How to fix Number of rows in detail section and insert blank rows if number of record less than rows fixed in detail section

I want to print three pay slips in an A4 size page. Page header and footer are fixed number of rows.
I want Detail section to print 8 records. If records are less than 8, remaining line should be blank printed and 3 pay slip print on one page.
Input parameters are Month and Year. I grouped each pay slip with personnel_id and placed the personel_id, name and bank account no. on group header section.
In detail section
Earnings: Total
Basic pay 20000
Arrear 1000
Qualification Pay 500
Deduction:
Medical Fee 2000
Club Fee 1000
In Group footer
Total Earning 21500
Total Deduction 3000
Net Pay 18500
Sometimes Earning has only one record and sometimes deduction has only one record.
I want to fix detail section with 8 or 10 rows and also 2 or 3 pay slips in one A4 size page.
Thanks.
Sample Data
E=Earnings
D=Deductions
Personnel ID EDname Cur_amount EDCode EDtype P_Month P_Year
17777-7 Basic Pension 20000 401 E 4 2014
17777-7 Arrear 1000 402 E 4 2014
17777-7 Qualification Alw. 5000 403 E 4 2014
17777-7 Medical Fee 2000 501 D 4 2014
17777-7 Club Fee 1000 502 D 4 2014
18888-8 Medical Fee 1500 501 D 4 2014
18888-8 Club Fee 700 502 D 4 2014
Report format on one page id just like below
Personnel_id:18888-8 Pay Slip
Name: xyz Month April, 2014 //`Group Header`
Account_No. 123444
Deduction:
Medical Fee 1500.00
Club Fee 700.00 // `Detail Section`
Total Earning: 0.00 // `Group Footer`
Total Deduction: -2200.00
Net pay -2200.00
Personnel_id:17777-7 Pay Slip
Name: ABC Month April, 2014
Account_No. 123456
Earnings:
Basic Pension 20000.00
Arrear 1000.00
Qualification Alw. 5000.00
Deduction:
Medical Fee 2000.00
Club Fee 1000.00
Total Earning: 21500.00
Total Deduction: 3000.00
Net pay 18500.00
according to your formula result of first pay slip is
Personnel_id:18888-8 Pay Slip
Name: xyz Month April, 2014
Account_No. 123444
Earnings:
Basic Pension
Arrear
Qualification Alw.
Deduction:
Medical Fee 1500.00
Club Fee 700.00
Total Earning: 0.00
Total Deduction: -2200.00
Net pay -2200.00
needed remaining 6 blank lines in detail section after Club fee
since detail section is fixed to 8 rows..
Simple way is to create 8 detail sections and place each field in one detail section.
Write a formula that will extend to the end of the detail section. Here write your code to print a line or leave it if you need a empty space.
if ISNULL(databasefiled)
then "--------------------------------------------------"
else totext(databasefield.value)
1)First of all fix height of detail section
by right click on detail section ->section expert->New Page Before checked->beside button of (x+2) write formula of ->
IF Remainder (RecordNumber, 8) = 0 THEN
TRUE
ELSE
FALSE
2)under detail section (suppose section3) is your detail section
then leave report section blank with needed space and else for footer put it in
page footer .. i think this will solve your problem.. mine is solved..