LOOKUP and REFERENCE Function - Cannot get either to work - merging tables - dax

I have numerous tables that I want to combine into one single table and build my dashboard from there. I am trying to do this with LOOKUPVALUE because I cannot get the relationships working correctly, otherwise I would be trying RELATED().
I want to fill in the values of Data[NEW] by looking up Data[Issue Key] in Sprint Name[Issue Key] and returning the corresponding value of Sprint Name[Sprint Name]
So far, I have
LOOKUPVALUE('Sprint Name'[Issue Key],'Sprint Name'[Issue Key],Data[Issue Key])
With this, I am getting the Issue Key values in the New column, but I want the Sprint Name. I have tried different combinations but still cannot get it to work, I either get a blank column or an error message.
Any help would be much appreciated, thank you!

Try This:
Result =
LOOKUPVALUE (
'Sprint Name'[Sprint Name],
'Sprint Name'[Issue Key], Data[Issue Key]
)

Related

An error when trying to aggregate using data.table

table users,
I have the code as shown in the screenshot and the resulting error. Unfortunately I can't share the data due to privacy issues. Does anyone have an idea of the error?
Thanks in advance!
When you use by, the resulting data.table should have one row per group. However, you try to assign multiple values to each of these lines by using unique() (given there are multiple unique values per group). You either have to wrap them in list() or paste(..., collapse = ", ") or something like that to just get a single value in each by.

Power Query Create conditional new column

I am having a little challenge.
In the attached sample data you can see that for a single AMI two different Product names exist.I do know that when that occurs only Linux/UNIX is correct. I would like to create a new column that will be looking for each AMI if it has 2 distinct string values then the new column to always be Linux/UNIX.
İmage
For the time being, i am using in power query text.contains and i specify manually those AMIs but this is not so productive. I am not aware if i can run loops with power query.
Thanks in advance for your help.
Filippos
Group the data on Ami and count Product names; merge results back into table; add custom column that checks the new column like =if [newcolumn] >1 then "Linux" else null
Another possibility. Sort table. Click to select product and type column then right click remove duplicates, which should only keep first instance. If you sorted correctly, then all the non Linuxes will be removed

How to get the matching data from two tables?

I'm used to compare 2 data, one data has an id and the other data is the one that needs comparing to get the matching datas. see code below.
DB::table('requests')->where('reqItem',$inventory->invItem)->get();
The code shown above displays all requests information that equals to the compared inventory item.
Now what i want to do now is to compare 2 tables without any id (ex. $inventory->invItem). I don't know how to ask this question but i hope you get what i mean. The figure below shows the way i wanted it to be.
You can run this query. Here, 'inventory' is the name of second table (change it accordingly)
DB::table('requests')
->join('inventory', 'requests.reqItem', '=', 'inventory.invItem')
->select('inventory.reqItem')
->get();

SAP BODS - Getting PK violation from a Table Comparison

I want to read from a table, change a couple column values for a few lines in a query, then update those lines on the same table.
I'm using SAP BODS, and that's what I tried:
I was about to insert images but just found out I can't insert images until 10 rep.
Anyway, I created a DataFlow where I have the same table as source and target.
A query to filter (using where) and change values (using mapping). And then a Table Comparison (where I expected those lines to be set to update, in this particular case), set table name on first entry, then PK in 'input primary key' and then the two columns I want to change in 'Compare columns'. No other changes from default that I can recall.
Got no warnings on 'validate all', and on execution I receive an ORA-00001 for the PK.
So ... I thought the Table Comparison would try to update, but seems like it's trying to insert instead. I want to know what I'm doing wrong and how could I get the job to do those updates. Thanks in advance.
Ps. I did search SO before asking and didn't find anything relevant.
Ok
So, turns out I just found what's going on a few minutes after posting the question.
Wasn't sure if I should answer my own question and took a look at this Etiquette for answering your own question
and decided to come back here and answer my own question.
For some reason I got stuck thinking that it was something to do with the Table Comparison trying to insert a line with a PK that's already there, instead of doing the update I wanted.
But after going back to the job to take another look at the issue, it occurred to me that maybe the problem could be a duplicate in the incoming data set. Made a few adjustment to filter those, and voilà.

SSRS Dropdown 'Any' Value not working

new to this world so looking for help with what I think wold be a simple thing to fix, however me and the guy who is training me on all that is SQL and SSRS cannot figure this out
I have a report within SSRS and SQL which is working perfectly bar one thing
I have a drop down list parameter which has all our customers names, and the report shows volumes of what that customer has obtained so far etc, and for an individual customer, this works perfectly. However, when trying to see the total volumes by choosing 'Any' from the drop down list, it returns no data, rather than returning everything
Can anyone please advise what I could be missing here, or what I need to show you to help resolve this issue
Cheers
Liam
Assuming you Stored Proc parameter is varchar and represents either customer names or an 'Any' value then the following should work.
SELECT myField1, myField2 -- etc
FROM myTable t
WHERE (t.ClientName = #myParameterName OR #myParameterName = 'Any')
Optionally Please Note: Personally I don't use SPs and usually just put the code to grab the data in the dataset. Some companies don't like you doing this but if you are able to do this I think this makes life easier.
If you can put the stored proc code directly in your dataset query then you can make the report more flexible. You can change your parameter to be MultiValue, you don't need and 'Any' value added to your parameter list either and then you can simply do something like
SELECT myField1, myField2 -- etc
FROM myTable t
WHERE t.ClientName IN(#myParameterName)
SSRS will take all the selected parameter values and inject them into the dataset query correctly, so there is nothing else you need to do. SSRS will also add a 'Select All' option to your parameter in case you want to gran data for everything. The report will work for 1, 2, 10 or all client names.

Resources