Power Query result doesn't match returned data - sql

This is a cross-post from the PowerBI forum:
I'm new to Power Query (Desktop) having previously only used it within Excel.
I have an SQL query source that returns the following data when viewed in the Power Query Editor:
yet in my report I get the following values for the Cabinet_DocID and Editor_ID:
I'm at a loss to explain what has happened to the values highlighted in red above. Why are they displaying as either 1 or two?
The only difference I can see in the source data between the columns that are correct/incorrect is that the values which were changed are numbers not text.
I feel like I am missing something stupid, but can't figure out what it is.
Any help greatly appreciated.
Thanks,
Alex.
PS. It seems like this response to the same problem might answer my question but I haven't done anything to either of these columns so I'm confused AF right now.

Okay, so it seems the numbers appearing were as a result of the values being numerical.
My initial attempt at changing the format to text lead to frustration because I didn't realise that the report doesn't automatically update the displayed format of any data displayed until you deselect and re-select all the columns.
This seems like a flaw to me, but I guess it's working as designed..?

Related

SAP - how to get dynamic table and content

I have one question which is getting me really tired lately, since I cannot find anything that could help me.
I have one SAP Smart Form, which is called by my ABAP program, but the thing is that once I call, I want to have on the main window some data coming, like:
I have these fields as you'll can see in the image below:
What I wish to do is to read the table wa-data. Ex:
wa-data-day
wa-data-day_des
wa-data-ctimb
Once I read these data, I need to put it to print in the respective fields, example:
day in the column 1, line 1,
day_des the column 2, line 2.
And then respectively, to fill the form.
Does anyone have tips how I can do that by SMARTFORMS transaction?
Thank you so much for any help guys.
I need to sort it out, getting the solution for this, how can I do that? What is the right steps to do?

PG admin shows empty data output

My query is apparently correct and I should get outputs given the fact that the data output board shows the column and the number of values per column, but it doesn't display the values.
Any help is welcome, looking forward to solving this, thank you!
A screenshot for clarity:
try to use explain (shift+f7) button to see how many rows ur query match

Compare Dates in a column corresponding to Changes in an other row

I have a large sample of medical data I need to try and analyze patterns in Excel worksheet.
I also put them up in a database in MS ACCESS to do my first filters and stuff.
I have the infos of patients, with tests results(POS or NEG), dates of the sample.
I need to be able to check for each patients when the results change from POS to NEG and from NEG to POS
and compare the dates of those two samples.
So far I was doing it manually which isn't viable for my sample.
I was trying to do something in SQL, but that didn't work out for me.
I also am trying to do some VBA or Excel formulas but I admit I'm getting kind of stumped.
I know I should do some for each cell loop or something but I really am lost.
I already grouped each patients info together using sub-totals and stuff.
Your help or at least pointers would be greatly appreciated :D
Here's an example of my data.
enter image description here
Use a formula like this, that in case the name is the same as the row before and the POS/NEG is different from the row before gives you the number of days in between, blank otherwise:
Of course it will give you an error if you try to use it on the 1st line, just enter it in the 2nd line and copy/paste in all the rest.
This should give you the basis for the rest of your analysis.

Excel SQL Table Formula's clearing

Apologies if asked elsewhere, having checked couldn't find anything. I've got a SQL driven table in Excel. When my table refreshes, resulting in no data, it completely clears out a series of none-SQL driven columns on the far right of the table. Is there any way at all I can force Excel to store the formula on the cell, regardless of whether the row has cleared?
To ellaborate on my comment:
Below shows a simple query returning 10 dates from a database. The right column is a simple formula in excel adding 10 to the date:
If I update the query to return the top 0, you find the formula disappears because there are no values to assign the formula to:
But, I then update the query to bring back the original 10 dates again, and hey-presto, the formula re-appears!:
So I wouldn't think that you need to worry that it has gone. I would expect that they would come back once you return some values from your query.
FYI - More help on calculated columns can be found here from Microsoft support.
Thanks! I think I had 'preserve column sort/filter/layout' unticked - which was causing the formula to be lost when the data refreshed! Schoolboy error, thanks again

Excel pivot table - wrong number ordering

I have an issue with number ordering in pivot tables. I tried almost everything... Observe:
As you can see somehow the pivot table sorts the days in a wrong order. In the data source all day values are numbers formatted as General - NOT DATES! Week numbers are number as well, again formatted as general.
Another interesting point is that a different pivot report which is using data from this file has the same issue. Note that the data is processed during the export and is converted to date using VBA DateValue function etc.
We use this report about a year now and we never had this issue before. Rebuilding the pivot table fixed the issue but in this report I have about 10 pivot tables and charts linked to VBA code, slicers, named cells etc. Rebuilding the whole file would take days.
First I´ve added a picture but my karma or whatever wasn´t good or something :)
Anyway, thank you for your comments, I´ve already figured it out so here is my answer:
I´ve just selected the row which I wanted to sort and sorted it with the basic excel sorting tool in the Home tab. So stupid...
Sorry for bothering with such a stupid question... :)