Skip to main content

Hi,

 

How can i use the below SQL query in Tableau to create a calculated field :

 

SELECT sum(count)

FROM d_dom_log_count dlc

WHERE

dlc.suborder_item_id > 0

AND SUBSTR(dlc.type_key,0,4) IN ('H.ES','H.WC','H.DP','H.AN','H.RQ','H.QL','H.CT','H.PD','H.OD')

5 risposte
  1. 1 nov 2021, 14:47

    @nitin Pal Singh​ 

    Hi, you can use:

    SUM(IF [suborder_item_id]>0 AND

    LEFT([dlc.type_key],4) IN ('H.ES','H.WC','H.DP','H.AN','H.RQ','H.QL','H.CT','H.PD','H.OD')

    THEN [count] END)

    If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

     

    Regards,

     

    Diego

    Tableau Ambassador