About resource limitation (MaxSubmitJob) in Slurm - ldap

I used the following command to set the maximum number of jobs a user can run.
However, the above setting did not work.
If anyone has any knowledge about this, could you please help me.
sacctmgr modify user account=<ldap-groupname> <ldap-username> set MaxSubmitJobs=2
I checked setting following command
sacctmgr show associations
outputs
Cluster Account User Partition Share Priority GrpJobs GrpTRES GrpSubmit GrpWall GrpTRESMins MaxJobs MaxTRES MaxTRESPerNode MaxSubmit MaxWall MaxTRESMins QOS Def QOS GrpTRESRunMin
---------- ---------- ---------- ---------- --------- ---------- ------- ------------- --------- ----------- ------------- ------- ------------- -------------- --------- ----------- ------------- -------------------- --------- -------------
clustername root 1 normal
clustername root root 1 normal
clustername ldap-groupname 1 normal
clustername ldap-groupname ldap-username 1 2 normal
`

Make sure AccountingStorageEnforce is set to limits in slurm.conf.

Related

get average of subtotal and wet with respect to distinct purchaseorderid and product category in DAX

i don't know where to start, pretty new in power bi or Dax
here is sample data
PurchaseOrderId SubTotal Wet ProductCategory
------------------ ----------- ----------- ------------------
1021 804.9767 233.4432 Wine
------------------ ----------- ----------- ------------------
1022 228.4651 66.2548 Beer
------------------ ----------- ----------- ------------------
1022 228.4651 66.2548 RTD
------------------ ----------- ----------- ------------------
1022 228.4651 66.2548 Wine
------------------ ----------- ----------- ------------------
1023 2791.2558 809.4641 Wine
------------------ ----------- ----------- ------------------
1023 2791.2558 809.4641 Beer
------------------ ----------- ----------- ------------------
1023 2791.2558 809.4641 Non-alcoholic
------------------ ----------- ----------- ------------------
1023 2791.2558 809.4641 RTD
------------------ ----------- ----------- ------------------
1024 396 114.84 Wine
------------------ ----------- ----------- ------------------
1025 374.2325 108.5274 Wine
------------------ ----------- ----------- ------------------
1026 864.093 250.5869 Wine
------------------ ----------- ----------- ------------------
1027 127.9069 37.093 Wine
what i want is i want average order value i.e
(Subtotal+Wet)/Count(Distinct PurchaseOrderId).
For this table Sum of distinct Subtotal is 5586.93 and Sum of
distinct wet is 1620.20,
total number of distinct purchaseorderid i.e number of orders is 7 so my average order value is (5586.93+1620.20)/7 = 1029.59,
i also want average order value by category
i am doing everything in DAX
so how this can be achieved?
Thanks in advance
You need to use this measure: I called my table (Test00) You can use yours in the same way.
AverageOfSubTotal =
VAR TblSummary = ADDCOLUMNS(
SUMMARIZE (Test00, Test00[PurchaseOrderId], Test00[ProductCategory]),
"Total_SubTotal",CALCULATE(SUM(Test00[SubTotal]))
)
RETURN
AVERAGEX(TblSummary,[Total_SubTotal])
If we test it on a table visual:
Now let's test the visual table report performance on DAX Studio:
The results are quite good!! 5 ms query time (4ms FE, 1 ms SE). 4 SE(Storage Engine) queries.
Use this as a new Measure
Avg Subtotal =
AVERAGEX(
SUMMARIZE(
'Table',
'Table'[PurchaseOrderId],
'Table'[ProductCategory],
'Table'[SubTotal]
),
'Table'[SubTotal]
)

Microsoft Access query using the alternative of ROW_NUMBER for duplicate date

Obviously there are a bunch of questions about ROW_NUMBER in MS Access and the usual response is that it does not exist but instead to use a COUNT(*) to create something similar. Unfortunately, doing so does not give me the results that I need.
My data looks like:
employee_id -------start_time ------- start_date
000670 -----------------12:30 ------------ 2019/03/28
000670 -----------------11:22 ------------ 2019/03/30
000676 -----------------13:00 ------------ 2019/03/28
000676 -----------------11:30 ------------ 2019/03/29
000676 -----------------14:00 ------------ 2019/03/29
000676 -----------------11:20 ------------ 2019/03/30
000676 -----------------14:00 ------------ 2019/03/30
000676 -----------------11:00 ------------ 2019/03/31
000677 -----------------11:20 ------------ 2019/03/28
000677 -----------------12:20 ------------ 2019/03/29
000678 -----------------12:00 ------------ 2019/03/29
Using the COUNT(*) I get:
employee_id -------- start_date ------- seq
000670 ------------ 2019/03/28 ------- 1
000670 ------------ 2019/03/30 ------- 2
000676 ------------ 2019/03/28 ------- 1
000676 ------------ 2019/03/29 ------- 3
000676 ------------ 2019/03/29 ------- 3
000676 ------------ 2019/03/30 ------- 5
000676 ------------ 2019/03/30 ------- 5
000676 ------------ 2019/03/31 ------- 6
000677 ------------ 2019/03/28 ------- 1
000677 ------------ 2019/03/29 ------- 2
000678 ------------ 2019/03/29 ------- 1
My current query is:
SELECT tbl.employee_id
, tbl.start_date
, ( SELECT COUNT(*)
FROM tbl AS tbl2
WHERE tbl2.employee_id = tbl.employee_id
AND tbl2.start_date <= tbl.start_date ) AS seq
FROM tbl
ORDER BY tbl.employee_id, tbl.start_date
What I am trying to get at is a unique count over employee_id and start_date so that my query output looks like:
employee_id -------- start_date ------- seq
000670 ------------ 2019/03/28 ------- 1
000670 ------------ 2019/03/30 ------- 2
000676 ------------ 2019/03/28 ------- 1
000676 ------------ 2019/03/29 ------- 2
000676 ------------ 2019/03/29 ------- 3
000676 ------------ 2019/03/30 ------- 4
000676 ------------ 2019/03/30 ------- 5
000676 ------------ 2019/03/31 ------- 6
000677 ------------ 2019/03/28 ------- 1
000677 ------------ 2019/03/29 ------- 2
000678 ------------ 2019/03/29 ------- 1
Please try this.
FOR SQL
SELECT
tbl.employee_id, tbl.start_date,
ROW_NUMBER() OVER(PARTITION BY employee_id ORDER BY employee_id)As Row_Num
FROM tbl
FOR MS ACCESS
SELECT tbl.employee_id
, tbl.start_date
, ( SELECT COUNT(*)
FROM tbl AS tbl2
WHERE tbl2.employee_id = tbl.employee_id
AND tbl2.start_date+tbl2.start_time < tbl.start_date+tbl.start_time
)+1 AS seq
FROM tbl

Selecting rows based on Priority -Sql

I have a case there I want to select row based Status cloumn Priorty
First Priorty should be Customer_Status with Status 'Deleted'
Second priority should be Family_Status with value 'Deleted'
[ Select top 1 with Family_Status ='Deleted']
If all Family_Status are "open' then select top 1 Family_Status ='Open'
Case : 1
CustomerID FamilyId Name Customer_Status Family_Status
------- -------- --------- --------------- -----------
1000 101 Vk Open Deleted
1000 102 vk Open Open
1000 103 vk Open Open
In this case i need result as
CustomerID FamilyId Name Customer_Status Family_Status
------- -------- --------- --------------- -----------
1000 101 Vk Open Open
Case2
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ------------
1000 101 Vk Open Open
1000 102 vk Deleted Open
1000 103 vk Open Open
In this case i need result as
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ------------
1000 102 vk Deleted Open
Case : 3
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ------------
1000 101 Vk Deleted Open
1000 102 vk Deleted Open
1000 103 vk Deleted Open
Output :
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ------------
1000 101 Vk Deleted Open
Case :4
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ------------
1000 101 Vk Open Deleted
1000 102 vk Open Deleted
1000 103 vk Open Deleted
In this case i need result as
CustomerID FamilyId Name Customer_Status Family_Status
------- --------- --------------- ---------
1000 101 Vk Open Deleted
Can anyone help on this query
Just order the result set:
SELECT TOP (1) *
FROM MyTable
ORDER BY Customer_Status, Family_Status DESC

Count records against filters

I have following 4 tables in sql with some records in them.
Users
UserId UserName EmploymentId
------ -------- -------------
1 User1 1
2 John 1
3 Doe 2
Country
CountryId countryName
------ --------
1 USA
2 UK
EmpStatus
EmploymentId EmpName
------ --------
1 Employed
2 Un-Employed
UserNationality (many to many )
UserId CountryId
------ --------
1 1
1 1
3 1
Now what I am trying to achieve is get show counts with filter criteria.i.e. I have view which should display filter criteria as shown below.
**Search Records**
Search by country
USA (3)
UK (0)
Search by employment
Employed (2)
Un-Employed (1)
Note that in UserNationality table there is a many to many relation ship between UserId and CountryId. So there may or may not be a record against a user.
I've tried counting by applying joins on the tables but it doesn't give desired results.
Also tried to used PARTITION but I've so far failed to generate the results. What approach should I use to solve this issue ?

sum of cost spent on advertisments on specific magazine (month?, year?)

Here are the tables //thanks for fixing my format//
ADV_COST
--------
PAGE_SIZE
MAG_ID
COST
//SAMPLE DATA ADV_COST//
PAGE_SIZE MAG_ID COST
-------------------- ---------- ----------
1/25 PAGE 1 40
1/8 PAGE 1 60
1/6 PAGE 1 65
...
ADS
--------
AD_ID
ADV_ID
PAGE_SIZE
MAG_ID
START_DATE
PURCH_DATE
NUM_ISSUES
//SAMPLE DATA ADS//
AD_ID ADV_ID PAGE_SIZE MAG_ID START_DAT PURCH_DAT NUM_ISSUES
---------- ---------- ---------- ---------- --------- --------- ----------
1 5 1/4 PAGE 1 01-APR-11 01-MAR-11 4
...
Here's the question:
Whirlpool ADV_ID=6; HOUSES: MAG_ID=1;
"How much money did Whirlpool spend in advertising in HOUSES this month?, this year?"
help please, thanks!
This is what I tried.
SQL> SELECT SUM(COST)
2 FROM DVD_ADV_COST A, DVD_ADS B
3 WHERE A.MAG_ID = B.MAG_ID
4 AND B.ADV_ID = 6
5 AND B.MAG_ID = 1;
Try
SELECT SUM(B.COST * A.NUM_ISSUES) AS TOTAL_COST
FROM DVD_ADS A,
DVD_ADV_COST B
WHERE B.MAG_ID = A.MAG_ID
AND B.PAGE_SIZE = A.PAGE_SIZE
AND A.ADV_ID = 6
AND A.MAG_ID = 1
and then add your date range to the WHERE clause as well
If it's not returning any data, make sure that you actually have entries for ADV_ID = 6.... your example show an entry for 5