looker dev difference between PDT and regular DT - looker

LookerML question:
I have got this snowflake query which joins one static table (does not refresh) and one table that refreshes every day.
I want to pop this query into Looker and create a simple Looker dashboard using it.
Two options I think are available to me to do so:
Create view file and PDT but that would mean I need to add a trigger value and the data including the static table would refresh, right? - Isn't this very inefficient?
Create regular DT with the explore being a PDT?

A derived table will be temporary and will not be written to the database. Each time the dashboard is refreshed, a query will be rerun against your data source to extract data.
A persistent derived table will store the data results in a database, whilst using a persistent strategy to refreshing the data based on time or a data driven trigger. If the persistent data already exists and is still valid, Looker will extract the results from the persisted data rather than creating a query against your source database.

Related

Do previous intraday/s data get automatically merged to the main table?

So I am new with Firebase and also new to linking Firebase data to BigQuery (I have some BigQuery experience though).
According to the documentation:
"After you link a project to BigQuery, the first daily export of events creates a corresponding dataset in the associated BigQuery project. Then, each day, raw event data for each linked app populates a new daily table in the associated dataset, and raw event data is streamed into a separate intraday BigQuery table in real-time."
Let's say I have this dataset mydataset.myapp, the corresponding BigQuery tables containing streamed data from Firebase looks like this:
mydataset.myapp.events_
mydataset.myapp.events_intraday_20191227
My question is:
Are the previous intradays (events_intraday_20191227) automatically merged/appended to the main table (events_) by the next day? So myapp will not be populated with intraday_<date> crumbs of data ? Just want to confirm how this works.
The table events_ contains all your data for different dates, the table events_intraday_ is a temporary table, which its data is moved into events_
In here you can find a video that explains how it works

How to find if file has been imported in Access database or created within it?

In my access database there is a dataset which I need to know how it has been created. I tried to backtrack and reached to a table for which I am not able to find any source data. I am pretty much sure that it has been imported from some where. I checked in "View" option there is not "SQL" view for that table. It only has "Datasheet" view and "Design View".
In access database is there any way to check that whether a file has been imported or has been created using SQL query within access database? Is there any "flag" raised or something like that?
No. Once data is persisted in a table, that's it.
If you need further info, you can have a Timestamp field with a default value of:
Now()
or, if a higher resolution than one second is needed:
Date() + Timer() / 86400
or another custom field where you record session info as you like during the import or creation of data.

Interactive search results table

In Asp.net using Visual Basic code I want to be able to query a database after a user inputs search criteria, get the results and display them in a table, with the ability of the user to click/select individual results and delete the corresponding data from the database. How can I do this?
You can do this by utilizing a Datagridview and binding data to it (by using OLEDB for example). Use the WHERE clause in your query to filter the records, based on the user input. (http://www.w3schools.com/sql/sql_where.asp)
The Datagrid has events you can use (delete, select, insert and update event).
See for more information: https://code.msdn.microsoft.com/VBASPNETGridView-19039173
Good luck!

Why does a DLookup in a Before Change data macro sometimes return an old value?

I have a large relational Access 2010 database. It is normalized, and includes some union queries that are very slow. I therefore thought I could speed things up by creating some cached fields. For example in tblOrder I would create a CustomerName field. To maintain this cached field I created a Before Change data macro that would dLookup the customer's company name from tblCustomer. It worked great. Then I created an After Update data macro in tblCustomer so when the user changes the Company Name all the child records would automatically be updated. It worked, but then the Before Change data macro fired and the dLookup returned the old Company Name. Any help would be very appreciated.
I made a sample of my problem using the Northwing Database. You can download a copy of it at http://www.thetechmentors.com/freestuff/exerciseFiles/msAccess/DlookupDatamacroProblem.zip
All you need to do is tweak the Before Change data macro on [tblOrder] to do the name lookup only when the [CustomerID] changes in that table. You can do that using the Updated() function like so:
That way when the macro fires as a result of the update performed from the After Update data macro on [tblCustomer], the [tblOrder].[CustomerID] value has not changed so the name lookup is bypassed.

updating batches of data

I am using GridView in asp .net and editing data with edit command field property (as we know after updating the edited row, we automatically update the database), and I want to use transactions (with begin to commit statement - including rollback) to commit this update query in database, after clicking in some button (after some events for example), not automatically to insert or update the edited data from grid directly to the DB...so I want to save them somewhere temporary (even many edited rows - not just one row) and then to confirm the transaction - to update the real tables in database...
Any suggestions are welcomed...
I've used some good links, but very helpful, like:
http://www.asp.net/learn/data-access/tutorial-63-cs.aspx
http://www.asp.net/learn/data-access/tutorial-66-cs.aspx
etc...
Well,
you can store your edited data in a DataTable in session. and then pass this data table as a bulk insert in to the database. 2 options are available for this
if you are using SQL Server 2005 you can use OpenXML to achieve this, as i have stated here
if you are using SQL Server 2008 youc an use Table Variables like i did here.
i hope it helps
First way:
Create session variable that will contain your DB object (DataTable or mapped objects).
The GridView should work with this instance instead of sending the data to the database.
Once editing is finished you may take the object from the session and save it in the way you normally do.
Second way:
I would use javascript to collect all changes on the client side while he is editing as a array of objects (each object is separate row).
Once the editing done, you can create json string from the collection and pass it to the server.
If your json object configuration is same as server class then you can use JavaScriptSerializer to deserialize your string into collection of object.
After that, you can save your objects in the way you normally do.

Resources