Solved

How use MAQL command Count with similar condition SQL (NOT EXISTS)

  • 16 February 2022
  • 5 replies
  • 45 views

Hello, 

please help me, how to correctly write this SELECT in MAQL.

 

SQL:

select count(*) FROM table_a WHERE NOT EXISTS(select * FROM table_b WHERE table_b.id_table_a = table_a.id_table_a) 

 

Thank you very much

Petr

icon

Best answer by Joseph Heun 16 February 2022, 15:18

View original

5 replies

Userlevel 2

The COUNT function can be used specifically on attributes. You can filter your metric using a WHERE Clause; using “ <>” as the operating symbol for does not equal. 

Please, can you write example for my SQL.

 

 

Userlevel 2

It could look something like this:

 

Select COUNT (attribute, connection point) where attribute <> attribute_value

 

I’m afraid that if you are looking to use a left outer join, like in SQL, it is not possible. We always use inner join by default. It is not possible to define what type of join is used when data are read into reports from connected datasets. 

 

I understand.

What do you recommend ?

 

TABLE A 

id_a INT - primary key

 

TABLE B

id_b - primary key

id_a - reference key to TABLE A

 

I need find out count FROM table A, which doesn't have relation into table B. 

 

Thank you for help

 

 

 

Userlevel 2

It may help if you were to provide a screenshot of your LDM and the insight/metric you are currently working with. 

Reply