1 Reply Latest reply on Apr 17, 2018 5:50 AM by Tim Dines

    nested if conditions

    chowdary v

      Hi, please anyone help me on this

      here I attached sample workbook,


      how to write below logic in SQL and tableau,


      In the SQL, Create new select columns called BlendedRevenue and BlendedRevenueRunrate. The logic for these columns is to pull either expected value (lead revenue)

      or revenue based on the product and date. Logic is:

      For Business loans, pull expectedLeadRevenue instead of matched count

      For Personal Loans and Auto Loans:

      -- if it is after the 10th of the month, pull expected revenue for the last month and current month, otherwise matchedRevenue

      -- if it is before the 10th of the month, pull expected revenue for last 2 months + current month

      for all other products, pull matched revenue.




        • 1. Re: nested if conditions
          Tim Dines

          I don't know your data and I know there is something wrong with the Personal and Automobile, but I think you can figure it out from here.  This is all done in Tableau and nothing has been done with SQL.  Maybe this is wrong, but again, I don't know your data.  Hope this is somehow helpful.

          1 of 1 people found this helpful