2 Replies Latest reply on Nov 14, 2018 7:22 AM by Anudeep Marupaka

    How to include ZN calculation in another calculation

    Anudeep Marupaka

      I created a crosstab in tableau from company and product data. I have a field, 'Total' which gives me the quantity of that product with that company. For some products if it isn't available at the company, 'Total' shows up blank.


      I used ZN Total -> ZN(LOOKUP(SUM(Total),0)) to replace those blanks with zero.


      I am trying to count zeros for each company using 'Zero Product' but it gives only if the zero is present in the data but not the ZN zero.


      I tried IF [Zn Total] = 0 THEN 1 END to calculate count of zeros but it's not working.


      PS - I tried changing the data from data source by cross joins but it's just duplicating the data and not feasible for huge data. This is just a sample I am attaching.


      Any help is much appretiated.