1 Reply Latest reply: Mar 15, 2017 7:24 AM by Arockiya Selvan A RSS

    Ranking data with condition in script

    Supriya R

      Hi,

       

      I have two tables, with datas as below

       

      table 1:

      campaignIDstartdateexpiration date
      103-13-201703-26-2017
      203-05-201703-17-2017
      303-02-201703-14-2017
      402-28-2017

      03-13-2017

       

      Table 2:    

      campaignIDvalue_typeadvertisementSales
      143523
      24672
      34453
      141256
      253334
      34542
      35556
      4432
      4545

       

      Now i need to add rank column in script by creating single table  like below, where i need to check for  condition

      1.) Active campaign, where expiration date >= today, will be given top ranking

      2.) latest Expired Campaign, where expiration date < today(), will be given least ranking.

       

          

      campaignIDvalue_typesum typeSumcampaign Status
      14advertisement47top 1
      24advertisement100top 2
      34advertisement45top 3
      14Sales79top 1
      24Sales36top 2
      34Sales3top 3

       

       

      Any idea, suggestion, workaround are all appreciated. Please help me to find solution for this. let me know if any clarification is required