Microsoft Word Mail Merge - Percentage format when cell contains both percent and text - ms-word

I am performing a mail merge and have an issue when trying to correct the percentage format. The problem is that the source column contains both a percent value and text. If I map the field, percents display as decimal in word. If I use the following, it displays correctly:
{=«Percent»*100 # 0%}
However, now when the row contains text I receive an error.
Is there another way I can do this?

Here is the formula you need
{={MERGEFIELD XYZ}*100\ #0.00%}

No, Word has no way to do string manipulation in its fields. Add another field / column to your data source for the text, or format the percentile in Excel before performing the merge.

Related

Crystal Reports not show numbers just blank field from XLS data source

I try to make a CR report from excel file. But the number fields are blank in CR (Like 97007244). If i put the cell one letter (Like X97007244), CR shows the field.
I tried to change cell type to text, but still not show.
What can I do?
Thanks!
The report probably assigned incorrect data type to that column.
Try to do Database, Verify Database...

VBA AdvancedFilter CriteriaRange reference (formatting?) issue

My macro is referencing a criteria range in one workbook (text values) and filters data in another workbook (using that range). However, the filtered list is empty (only contains headers). I tried testing many different ways and have isolated the issue to, probably, the formatting of my criteria range. I.e. if I pass it text values via array (using Autofilter instead), it works, but not when referencing a range in excel (with AdvancedFilter). Criteria range ("E2:E5") is formatted as "General" and appears in a single column like this:
WFHF62330002
WFHF63840002
WFHF64540002
Does CriteriaRange take values as a column or row, i.e. do I need to transpose these into a row (tried - doesn't work)? Or is there a way to bring it to text formatting in some way? Not sure how to go about this issue.
Relevant code:
With wb_input.Worksheets("TempSheet").Range("A1:Y99999")
.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=wb_output.Sheets("Setup").Range("E2:E15")
End With
I'm not posting the whole macro - hopefully the explanation above is sufficient. Thanks a lot!
You have to include the Header to your Criteria Range - Criteria range ("E1:E5"), if the cell "E1" is the Header :-) And the Header must be the same as the Header in the Sheet where you are applying the Filter.
See here in this post:
Excel VBA - AdvancedFilter

Keep leading zeros when joining data sources in tableau

I am trying to create a data source in Tableau (10.0) where I am joining a table from SQL with an Excel file. The join happens on a site id but when reading the id from the excel source, Tableau strips the leading zeros (and SQL keeps leading zeros). I see this example
to add the leading zeros back as a new, calculated field. But the join is still dropping rows because the id is not properly formatted when making the join.
How do I get the excel data source to read the column with the leading zeros so I can do the join?
Launch Excel and choose to open a new blank workbook.
Click the Data tab and select From Text.
Browse to the saved CSV file and select Import.
Ensure that Delimited is selected and click Next.
Leave Tab as the delimiter and click Next.
Select the column containing the data with leading zeros and click
Text.
Repeat for each column which contains leading zeros.
Click Finish.
Click OK.
Never heard of or used tableau, but it sounds as though something (jet/ace database driver being used to read excel file?) is determining the column to be numeric and parsing the data as numbers, losing leading zeroes
If your attempts at putting them back are giving you grief, I'd recommend trying the other direction instead; get sqlserver to convert its strings to numbers. Number matching should be more reliable than String matching, so long as the two systems don't handle rounding differently :)
If your Excel file was read in from a CSV and the Site ID is showing "Number Stored as Text", I think you can solve your problem by telling Tableau on the Data Source entry that the field is actually a string. On the preview data source view, change the "#" (designating number) to string so that both the SQL source and the Excel source are both strings before doing the join.
This typically has to do with the way Excel stores values as mentioned above. I would play around with the number formatting for the Site ID column in Excel itself, not Tableau, and changed that two "Text" in Excel. You can verify if Tableau will read it properly with the leading 0s by exporting your excel file to csv and looking in the csv files to see if the leading 0s are still there.

sql developer export table to xls

How to export the entire query results to xls format without the value truncated (with the header intact).
e.g
the value is round up to 276408428673510000 when the actual value is suppose to be 276408428673508271
Using this method
After selecting the data by clicking 'Ctrl+ A' in gride, use 'Ctrl+Shift+C' to copy the data with Header. After pasting the data into MS Excel, try changing the 'format' to number or text. You must be knowing that 'format cells' is available as a right click option in MS Excel.
My solution was use the LPAD or RPAD functions, you give the exact length that you want and when you export the data, these don't round it.

Display string formula not used when exporting from Crystal Reports XI

I've produced a report in Crystal Reports XI where I in one of the fields have used the display string formula to alter the apperance of some data as well as group similar data values to one value (e.g. "neg", "negative", and "-" now all displays as "negative" in the report.)
However, now when I export the report to CSV for delivery to a customer the raw data, and not the display string formula result, is in the export. I've tried all 4 settings with the checkboxes in the CSV export options.
Is there any way to make the display string formatted data beeing exported to the CSV?
Are there any alternate ways of achiving the desired formatting and getting the formatting preserved in CSV export?
Unfortunately, i've not found a way of using the display string formula and achieving the desired result.
Instead create a new formula and replace the object on the report with the new formula.
L