Why is a lookup column returning wrong value in Dataverse PowerAPP? - relationship

So I have two table Program and Program Input. Program table comes from SQL and Program Input is a table I made in dataverse. I am trying to tie in program name into program input table so I can make a form. The desired relationship is many to 1 (Program Name to Program table). Right now I did a look up for program name on both table, but program name is returning program ID from the Program table (it should not be). Any ideas what I am doing wrong?
Here is an example of the Program Table.
Program Table Example:
Program ID
Program Name
1012
PM1
1013
Res
1014
PX2
1012
Dogwood
Program Input
Name
Program Name
1
1012
2
1013
3
1014
4
1015
Dataverse Program Input Table
Relationship

Related

Excel - Index and match many to many results vertically

in excel document, I have in sheet "Documents" reference nr. with corresponding values, for example:
Column A
Column B
Reference
Document
12345
Document1
12345
Document2
12345
Document3
54321
Contract1
54321
Contract2
In sheet "Main", I have the following
Column A
Column B
Column C
Reference
Document
12345
12345
12345
12345
12345
12345
12345
12345
12345
I would need result from sheet "Documents" from column B in column C of sheet "Main". In sheet "Main" there are always 9 reference numbers (for each) reference) but in sheet "Documents" reference nr. varies from 2 to 8. So, for these reference nr.in sheet "Main" which are excessive, I would need some kind of different result, for example #N/A or similar...
I have tried with array formulas with no success.
Help would be appricated...
Many thanks
Give a try to-
=MAP(A2:A10,LAMBDA(x,IFERROR(INDEX(FILTER(Documents!B:B,Documents!A:A=x),ROW(x)-ROW($A$1)),"Your Message")))

Find all matching results in column and output their adjacent rows

Summary
I have a database of ~1500 entries. Some of them have more than one entry (up to 5) under the same identifier. I have a pre-set list of IDs I would like to check to see if they have multiple records, and if so, pull all of them, so I can compare them for differences.
Current solution
I currently have this working correctly, using a method to pull the 1st, 2nd, 3rd, 4th and 5th response respectively. The current formula is:
=INDEX('DATABASE'!$B:$B,SMALL(IF($A2='DATABASE'!$A:$A,ROW('DATABASE'!$A:$A)-ROW('DATABASE'!$A$1)+1),1)) for the 1st result, =INDEX('DATABASE'!$B:$B,SMALL(IF($A2='DATABASE'!$A:$A,ROW('DATABASE'!$A:$A)-ROW('DATABASE'!$A$1)+1),2)) for the second, and so on. In this case, the above code would check the value in A2 (ID2Check), and then do a match for it on the 'DATABASE' sheet in column A. If it matches, it will return the first value that matches from column B. The second piece of code above does the same, except it returns the second match from column B. ID2Check is populated by me, and the Results 1-5 are the code output. For example:
Database:
ID
Data Item
AAA
Lemons
111
Greenhouse
FOO
Computer
AAA
Monitor
CAT
Coffee
ORANGE
Pintglass
123
Birthday
FOO
Avengers
AAA
Plasters
FOO
NachoTaco
Code output:
ID2Check
Result 1
Result 2
Result 3
Result 4
Result 5
AAA
Lemons
Monitor
123
Birthday
FOO
Computer
Avengers
NachoTaco
Problem
This solution works correctly, and will pull the expected values as required. The problem is, as this code needs to be entered 5 times per identifier, and there are ~1500 records to check, I need to flash fill 7500 formulas. Unsurprisingly, this leads to Excel crashing and becoming unresponsive for the best part of 30 minutes. I am looking to find a solution that would be more efficient and stable when running en-mass. Any assistance would be appreciated.
Final Notes / Info
I'm using MSO 365, version 2202 (I cannot update beyond this). This will be run in the Desktop version of Excel. I would prefer this is done exclusively using formulas, but I am open to using Visual Basic if it would be otherwise impossible or incredibly inefficient.
=UNIQUE(C5:C15)
=TRANSPOSE(FILTER($D$5:$D$15;$C$5:$C$15=F5))
If you have access to HSTACK() function then could try-
=HSTACK(UNIQUE(A2:A11),TEXTSPLIT(TEXTJOIN("/",FALSE,BYROW(UNIQUE(A2:A11),LAMBDA(x,TEXTJOIN("|",TRUE,FILTER(B2:B11,A2:A11=x))))),"|","/",,,""))

Coverting a CSV with 2 tables to SQLite

I have a CSV file that is produced via a program. (airodump-ng to be precise) that I would like to convert into a .db file a SQLite database.
I would preferably like it this was as to make the data a lot easier to navigate around but the issue I have is the the produced CSV has 2 separate tables within it.
Im not the most advantage user as this is kind of just a little fun project, so I found a python based script over at Github called csvs-to-sqlite.
I found various other but csvs-to-sqlite seemed to do exactly what I wanted to do.
BSSID, First time seen, Last time seen, channel, Speed, Privacy,
Cipher, Authentication, Power, # beacons, # IV, LAN IP, ID-length,
ESSID, Key
00:00:00:00:00:00, 2018-01-01 23:23:23, 2018-01-01 23:23:23,10,100,
OPN,, PSK,-60,2,0, 0. 0. 0. 0,15,TestNode254846254,
11:11:11:11:11:11, 2018-01-01 23:23:23, 2018-01-01 23:23:23,2,,
WPA2, CCMP, ,-67,1,0, 0. 0. 0. 0,13,WIFI456824625,
22:22:22:22:22:22, 2018-01-01 23:23:23, 2018-01-01 23:23:23,4,, WPA2
WPA, , MGT,-67,3,0, 0. 0. 0. 0,11,45895142357,
,,,,,,,,,,,,,,
Station MAC, First time seen, Last time seen, Power, # packets,
BSSID, Probed ESSIDs,,,,,,,,
00:00:00:00:00:00, 2018-01-01 23:23:23, 2018-01-01
23:23:23,-100,100, (not associated) ,Wifi,,,,,,,,
11:11:11:11:11:11, 2018-01-01 23:23:23, 2018-01-01 23:23:23,-55,3,
(not associated) ,TestNode254846254,,,,,,,,
22:22:22:22:22:22, 2018-01-01 23:23:23, 2018-01-01
23:23:23,-63,1,00:00:00:00:00:00,,,,,,,,,
As an inital test I ran the CSV through to see if a .db SQLite database would be produced and it worked as expected but of course due to the nature of the basic run the first table worked perfectly but the second table obviously appears mearly appears as data within the original table, I would like the data to be outputted into 2 separate tables if possible.
As it is a CSV the fields are of course separated via commas and the 2 tables are separates via 14 consecutive commas which appears when viewed as a spreadsheet and a blank line between the commas.
Does anyone potentially know how I could relativley easily convert my data over to SQLite.
Regards.
Is this a one-time task, and manual approach is ok? If so, you could use a text manipulation tool like Notepad++ that has regex search and replace, and regex search and replace the 14 commas and everything after them to the end of the line with an empty string.
Save to a separate file, and now you have a CSV file that only contains the first table.
Reload the original file, regex search and replace everything from the start of the line to end of the 14 commas, and now you have a csv file that only contains the second table.
Run each of the 2 tables through your csv to sql helper.

Looking to count the number of times a company name appears in a column, while excluding a duplicate value in another column

Spreadsheet column setup:
A:Name B:Hours C:Client D:Invoice# E:Date
Joe 8 Acme 123 8/21/18
Bill 12 Zorg 456 8/19/18
John 9 Acme 123 8/21/18
Ben 15 Acme 987 8/5/18
I want to count the number of jobs we did for a client for the month.
Each individual job is denoted by the invoice number. A job may have multiple people on it so the same invoice number will be duplicated in column D.
I'd like exclude those duplicates so I get a true count of jobs for a particular client regardless of how many people were actually on the job.
Using the example above, if I ask for total number of "Acme" jobs this month, I need the output to read 2 (since invoice 123 had a couple guys on it) not 3 due to it not excluding the duplicate invoice number.
Nothing I try or search on the internet like function CountIf quite meets my unique parameters.
Please advise, Thank you.

Crystal Reports - Select records via range of text

I have a report that is querying a transaction table, I have simplified the table below:
CREATE TABLE [dbo].[NL_Trans](
[NT_PRIMARY] [int] NOT NULL,
[NT_CODE] [varchar][20] NOT NULL,
[NT_CAT1] [varchar](6) NOT NULL,
[NT_CAT2] [varchar](6) NOT NULL,
)
Data in the table is like:
NT_PRIMARY -- NT_CODE --- NT_CAT1 --- NT_CAT2
---------------------------------------------
1 AB100 123 234
2 AB200 124 234
3 AB300 125 235
4 AB400 126 235
The table has several years data and has 8 NT_CAT fields, these are numbers stored as varchar's.
I have a large list of categories to limit the query to but I can't find a way to limit this to ranges of text.
So far I have tried:
{NL_Trans.NT_CAT1} IN "124" to "125"
AND
(CDbl ({NL_Trans.NT_CAT1}) IN 124 to 125))
Neither of which are returning any results.
I can't use a large list of OR statements as the ranges are more than 100 items in some cases meaning I'd need thousands of lines.
Can anyone give an alternative that will work (and leverage the Catagories index if possible) or tell me why either of the statements above are not working?
First of all, you cannot trust Crystal to evaluate a statement like "5" in "1" to "10". I don't know the basis for these comparisons, but I would guess that it is based on ascii values of the leading digits or something like that.
With that being said, converting to a double should work... Is it possible you have non-numeric characters in your NT_CAT fields? You should try something like this in your record selection formula and see if you have better luck:
if not(isnull({NL_TRANS.NT_CAT1})) and isnumeric({NL_TRANS.NT_CAT1}) then cdbl({NL_TRANS.NT_CAT1}) in 124 to 125
The downside to this is that Crystal won't add this to the WHERE-clause to be handled on the SQL Server, it will do the selection on the local machine instead. To get around that performance hit, you can create a SQL Expression in Crystal that will do the string-to-numeric conversion for you. I don't use TSQL so I'm not going to try and convert my Crystal code snippet to it, but if you created the SQL Expression {%ConvertCAT1ToNumeric} you could just use this in your selection formula:
not(isnull({%ConvertCAT1ToNumeric})) and {%ConvertCAT1ToNumeric} in 124 to 125
Good luck.
try this.
remove thoose lines ** that is the one of criteria type.. you might be looking for a range
**{NL_Trans.NT_CAT1} IN "124" to "125"
**AND
and only put this to the selection criteria but first off, try select a different field for a number range formula, copy the whole formula and create a new criteria. rename the field to the approriate one and run the report. (dont forget to delete the 1st dummy criteria you did)
original :
(CDbl ({NL_Trans.NT_CAT1}) IN 124 to 125))
i think this is the formula to range numbers
(CDbl ({NL_Trans.NT_CAT1}) between 124 to 125))

Resources