1 Reply Latest reply on Jan 14, 2014 5:22 AM by Mateusz Waligórski

    How to apply filter in a calculated field?

    Mateusz Waligórski



      I am trying to make a calculated field that would show the number of uploads. Our SQL programmer wrote this for me, as he doesn't know Tableau's syntax:


      select cast([date] as DATE) as [date], count(1) as number into #uploads

      from files f with(nolock)

      inner join files fr with(nolock) on fr.idl=f.id

      where f.[id_user_from] is null and f.[id_file_from] is null

      group by cast([date] as DATE)


      select * from #uploads

      order by [date]


      This shows number of uploads grouped by date. What I would love to do is create a calculated field, which would display the same result, as applying filters and using CNT(date) to display number of uploads.



      Any help would be greatly appreciated!