Skip to main content
Solved

How to fetch details of Contact User Query Profiles?

  • Jul 26, 2024 5:01 PM UTC
  • 3 replies
  • 117 views

Forum|alt.badge.img+7

We have a requirement to fetch what all Cost Centers are linked to Contact User Query Profiles.

Don’t see any DMW or DB table that gives such relation.

Best answer by McrPauloV

Hi,

You dont have commented your assyst version, but I think this query below (tested on assystdb 11.8) will work for you.

img1 - assyst config

 

img2 - Query Results

img3 - SQL Query

SELECT uqp.usr_qry_prof_sc "CONT_USER_QRY_PRF_SC"
    ,uqp.usr_qry_prof_n "CONT_USER_QRY_PRF_N"
    ,cc.cost_centre_sc "COST_CENTRE_SC"
    ,cc.cost_centre_n "COST_CENTRE_N"
FROM usr_qry_prof uqp
INNER JOIN usr_qry_crit uqc ON uqc.usr_qry_prof_id = uqp.usr_qry_prof_id
INNER JOIN usr_qry_crit_val uqcv ON uqcv.usr_qry_crit_id = uqc.usr_qry_crit_id
INNER JOIN cost_centre cc ON cc.cost_centre_id = start_int
WHERE uqc.usr_qry_crit_n = 'costCentreId'

View original

3 replies

McrPauloV
Sidekick (Customer)
Forum|alt.badge.img+6
  • Sidekick (Customer)
  • Answer
  • Jul 26, 2024 8:50 PM UTC

Hi,

You dont have commented your assyst version, but I think this query below (tested on assystdb 11.8) will work for you.

img1 - assyst config

 

img2 - Query Results

img3 - SQL Query

SELECT uqp.usr_qry_prof_sc "CONT_USER_QRY_PRF_SC"
    ,uqp.usr_qry_prof_n "CONT_USER_QRY_PRF_N"
    ,cc.cost_centre_sc "COST_CENTRE_SC"
    ,cc.cost_centre_n "COST_CENTRE_N"
FROM usr_qry_prof uqp
INNER JOIN usr_qry_crit uqc ON uqc.usr_qry_prof_id = uqp.usr_qry_prof_id
INNER JOIN usr_qry_crit_val uqcv ON uqcv.usr_qry_crit_id = uqc.usr_qry_crit_id
INNER JOIN cost_centre cc ON cc.cost_centre_id = start_int
WHERE uqc.usr_qry_crit_n = 'costCentreId'


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • Jul 26, 2024 8:58 PM UTC

Thank you so much @McrPauloV. This SQL query gives me the exact data that I was looking for.


McrPauloV
Sidekick (Customer)
Forum|alt.badge.img+6
  • Sidekick (Customer)
  • Jul 26, 2024 9:02 PM UTC

Great!