Questions tagged [aginity]
88 questions
0
votes
1 answer
Get Items Purchased Together + Most frequently Purchased together
I'm having such trouble visualizing this and need some help.
Tasked with finding items that are most frequently purchased together.
Like what do customers usually add to their purchase. And how many times has that occurred.
All the data is in 1…

Z41N
- 97
- 10
0
votes
1 answer
CREATE/DROP call from Python to SQL (Aginity, Netezza) not working
I am trying to figure out how to upload/insert csv table files into Aginity Workbench (uses Netezza driver) using Python for both existing and non-existing tables.
Is there a function that does a direct upload from a specified pathway into the SQL…

Mimi Chung
- 97
- 7
0
votes
0 answers
RFM Analysis Not Outputting All Customer IDs
So I'm working on an RFM analysis, and with lots of help, was able to put together the following query that outputs the customer_id, r score, f score, m score, and lastly a combined rfm score:
--This will first create quintiles using the ntile…

Z41N
- 97
- 10
0
votes
2 answers
Current date and past 30 days total value
The code I currently have shows me the current value for everyday and gives the running total.
select t.lgl_entity_nm, d.date_key,
count(distinct s.site_key) AS Dis,
SUM(Dis) over (partition by t.lgl_entity_nm order by d.date_key ASC rows…

darkpunk
- 17
- 9
0
votes
2 answers
How to force output to show only 1 row if multiple values appear
I have the following query:
SELECT
item_code,
description_global,
dept_item || class1_item AS division,
view_year_code AS year,
ssn AS season
FROM
us_raw.l_ims_sum_code_master
WHERE
ssn IN (3,4)
AND view_year_code…

Z41N
- 97
- 10
0
votes
1 answer
I am not able to see QH_CLIENT_WORKSTATION_NAME column, it is Null. I'm querying fron Aginity connected on Netezza server
I would like to start monitoring our system closely as to see who and at what time did a user run a query.
Currently, on the tables from HIST DB, we are able to see the query Texts, username, date, time, and client IP. But what we are more…
0
votes
1 answer
And/or SQL statement
I'm struggling to get a SQL statement to run.
I need to have an and / or statement which gives me:
Where Condition 1 is true
OR
Where both Condition 2 AND Condition 3 are true. (not only one of them)
Appreciate some ideas :)

Øyvind Seljenes
- 11
- 1
0
votes
3 answers
Forcing the color_code output to be a different string using CASE
So I was successfully able to pull the data that I need, however the issue now is that the color_code is a 2-digit number that not everyone knows. So, to rectify, I'd like to create a CASE statement that would replace each of these 84 unique color…

Z41N
- 97
- 10
0
votes
1 answer
How to relate two columns from separate tables, if the values are SIMILAR not EXACT?
I have two columns that I'm trying to join, but am getting a bunch of nulls because instead of it saying "SWEATER" in both columns, it says "SWEATER" in one and "SWEAT" in another. I did a FULL OUTER JOIN, and although a lot have matched, there are…

Z41N
- 97
- 10
0
votes
0 answers
How to add listagg to code provided in SQL
I have been given work to do regarding trading, I want to find the buyer and seller of different assets, I have the data for who the buyer and the seller are for each trade but I've been told to use the LISTAGG function on the data sets which are…

dom_2108
- 37
- 5
0
votes
1 answer
RedShift Error when using COUNT (Distinct XXX) ERROR: XX000: This type of correlated subquery pattern is not supported due to internal error
I have a small query running in RedShift through Aginity that is getting the following error:
ERROR: XX000: This type of correlated subquery pattern is not supported due to internal error
Current Query:
SELECT 'MYSCHEMA.MYTABLE.FIELDA' as…

Matt
- 14,906
- 27
- 99
- 149
0
votes
1 answer
Variable dates in Netezza
I wish to define a start and end date for my SQL query in Netezza.
My code is re-run every quarter to pull the latest data and rather than changing the date fields in multiple locations in the code I wish to define a start and end date that can be…

TheGoat
- 2,587
- 3
- 25
- 58
0
votes
1 answer
SQL equivalent of COUNTIFs Excel formula?
I am trying to recreate some excel formula in Netezza Aginity SQL so the processing can be done at the database level, but struggling with countifs.
The formula is roughly:
If( Countifs( policycolumn, policy, matchcolumn, "Match", codecolumn, code)…

MikeLanglois
- 25
- 7
0
votes
1 answer
How can I create an ID column randomly, without repeating integers?
Suppose I have a table called sourcetable with colA, colB, colC. I simply want to create an id column with non-repeating, unique, and random integers. How can I create this either in netezza SQL or using proc SQL (SAS)?
user4892176
0
votes
1 answer
How to execute a SQL statement which is stored as a value in the database?
I have some SQL statements stored in our Netezza DWH. I want to run some of these (or at least one) from a new query.
I have tried a lot of things using Declare and such, but it seems not to be working on the Netezza.
This is a query that has been…

D Bakker
- 1