Looker: Create an explore minus required date fields - looker

I'm fairly new to looker. There's this explore I'd like to use to build a table. It has all the view files I need joined to it, mainly one view file named insights.view. However, insights.view is currently used with dates and I'd like to create a new explore minus these date dimensions. In the current explore these date dimensions are required filters. How should I go about creating this new explore with only the dimensions I need and w/o the date filters from the insights.view?

It doesn't sound like the date dimensions are the issue, but the fact that the explore that currently exists has required filters on those dimensions.
You could copy/paste the explore definition and not bring in the required filters.
Or it'd be better to extend the Explore and try something like this depending on how they made the filters required:
https://help.looker.com/hc/en-us/articles/4420210624659-When-extending-an-explore-can-I-exclude-an-existing-parameter-like-always-filter-or-conditionally-filter-on-the-new-extended-explore-Community-

Related

Generate and display html table with user data from wordpress

Update: With the help of the answerer below I figured out how to do this. Basically I used a WP Query to get users and their user metadata and I sorted and placed the data in a for each loop in a table.
I'm new to PHP and I need some help. Basically I want to create a leaderboard with different user data. I want to display it in an html table.
This is kinda what i want:
Username GamiPress Points Time since last login
And I want the table to be populated with these data amongst others automatically. I want two versions one that is sorted with the 15 users who have the most points and one that sorts on the 15 users that logged in last.
Can someone point me to the right place on how I can best implement this?
I basically want to create the GamiPress Leaderboard add-on that I, unfortunately, can't afford, but with some extra fields.
There are multiple steps to do if you want to achieve this:
1) Add meta field to your users, so you can store the points. For example you can use "Advanced Custom Fields" plugin for this.
2) Write a function for adding points to this field. Define when this function will be fired.
3) Query the users ordered by that meta value and display it (get_users($args) might be useful).
4) For the Last-Login value you can use a plugin (google Wordpress Last Login) and write another Query and order results by that meta field. You can also write this by your own, here is a link I found: https://www.wpbeginner.com/plugins/how-to-show-users-last-login-date-in-wordpress/
I don't know if this is what you were looking for.
Or did you want to see an example code how you use a wp query and display data in html table?

APEX 4.1 SQL Query using a page item to define FROM

I am trying to utilize a single tabular form to handle a couple minor tables since I cannot have multiple updateable reports on a single page. The easiest way I could figure to adjust what table I was modifying was to use a select list to choose which table I am viewing/editing.
The select list contains a display of "Supervisor" and "School"
resulting in SUPERVISOR and SCHOOL respectively
the items name is P8_TABLE
Region Source:
select *
from #OWNER#."G06_" || :P8_TABLE
The tables are named G06_SUPERVISOR and G06_SCHOOL
However the query returns:
ORA-00933: SQL command not properly ended
I'm afraid that this won't work. As far as I can tell, tabular form is to be based on one table only (i.e. you can't have a JOIN in there; even if you're displaying values from some other table, you'd rather create functions which would return those values).
That being said, principle you'd like to use means that tabular form underlying table is unknown (as it can vary, depending on what you select in P8_TABLE select list item), which - in turn - means that column names also differ (unless all of those tables share the same column list).
If we presume that above is correct, then I'd suggest you to abandon that approach and maintain every "minor table" on its own tabular form page. It will be just a little bit more typing & clicking, but I wouldn't worry about it.
Hopefully, someone else knows how to do it the way you'd want it to.
You cant make a tabular form query source dynamic. And since the two tables you want to be displayed and be updatable doesnt have common number and usage of their columns, the only way I can think of is separating the two tables and diplaying one tabular form for each table. Though, Apex 4.1 or even the latest Apex 5 doesnt allow multiple tabular form, you can make this possible by using javascript's iframe. You'll need to use javascript since you want to modify the interface of the report/page.

Multiple value selection and optional filter in SSRS 2005 report

I had done a fair share of research before asking this here.
Firstly, i would like to create a drop-down filter #accessVar with the ability to select multiple values. It would be easy if not due to my special requirement. My dataset statement is:
SELECT PASS_M, ENTRY_DT, EXIT_DT, WORKED_HRS, ACCESS_LOCATION_X, IC_N, COMPANY_M, CONSECUTIVE_D
FROM TEMP_TARGET
WHERE (CONSECUTIVE_D >= #consecDays) AND (ENTRY_DT BETWEEN #startDate AND #endDate) AND
(ACCESS_LOCATION_X LIKE #accessVar) AND
(IC_N LIKE #icVAr)
However i need to make use the %wildcard for #accessVar(e.g 'BT%') hence i am unable to use the operator IN. What can i do? I am using SSRS2005. Please advice me.
You can do this using Filter at the Data Set properties. Before that you need to remove the (ACCESS_LOCATION_X LIKE #accessVar) from your data set query.
set the expression as follows[Modify your parameter name].
=ACCESS_LOCATION_X Like "*"+Parameters!param.Value+"*"
Then configure the Dataset properties Filter tab as follows.
After that you can run your report. Following screenshot searches for "en" word in the report data set and returns the result set.
Hope this helps!

Reorder Entity Properties

I have an Entity (Extensions) with a number of properties (e.g. id, extension, prefix) and a few navigation properties (phones_departments, phones_buildings) - they show up in the order they display in the EDMX...but what if I want them to display in a different order? I'm using Dynamic Data - is there a way to accomplish this?
are you showing your data in a grid?
if yes, you could sort grid columns based on some other property. You could for example have a ColumnOrder property in your data store and update that. The code to sort the columns varies per grid, but it is usually easy to do.
Main point being is that you want to modify the display level logic, not the way the actual object is created. since your order can always very per application.

D6: how to get at node fields in preprocess_page()?

i created a view that displays my homepage fine but now a modification is needed: i load 2 fields (images) in my view but need to only display one of those, depending on the value of a third (date) field and today's date. if date field is later than today, show image y and if its earlier than today show image x. this kind of logic cant be done in a view.
so in my template.php id like to output x or y as $vars['img'] in the preprocess_page function. im just wondering, how do i get at the values of those fields? its not a node but a list of node teasers.
the function gets passed &$vars but a print_r of those just shows the html output.
custom sql seems not the way to go.
when i load the view, i just get the html it outputs but (i think) i need the raw data to make the date comparison.
thanks for any pointers!
I'm sure there are some ways to do this, some more hackier than others. I would:
Make a template specific to your view
Create a preprocess function for the view and create a boolean variable, by checking which img that should be displayed.
Lastly I would alter the template slightly by making an if statement that checks if it should display img x or y.
This solution is pretty easy and straight forward, the downside is that it's not completely general as you most likely will need to know the names of the cck field names you are using. It's doubtful you would be able to generalize this anyways.
Edit:
To clarify a bit. You can look at the general views template that's being used, it will give you some insight as to how views prints the different fields. Generally getting at the fields is usually not a big problem when you have the $node object. The reason is that cck adds the fields to the $node object so you can access it there. I believe you can do something in the line of $node->field_[the_name] to get to the field. I would suggest that you use the devel module if you don't already and do a dpm($node) somewhere in the template where you loop through the nodes. That will enable you to see what has been defined on the $node object. It shouldn't be a big problem to print the img from there.
How about using preprocess_node() instead?

Resources