12 Replies Latest reply on Oct 27, 2016 2:54 AM by Norbert Maijoor

# how to develop qlikview calculation in tableau

Hi All,
I have qlikview expression YTD Calculation  like this

 'YTD   : ' &(sum(

{<

creation_date= {">=\$(=Date(YearStart(max(creation_date))))<=\$(=max(creation_date))" }, Creation_Week= , Creation_Quarter=, Creation_Month=,Creation_MonthYear= >}

distinct invoice_amount)

I need to write same calculation in tableau as well can anyone help on it how can i apply same calculation in tableau

Please help me based on this i need develop so many things. Thanks in Advance.

• ###### 1. Re: how to develop qlikview calculation in tableau

You can create a YTD Calculated field as below -->

replace [order date] with CREATION DATE and [sales] with DISTINCT INVOICE AMOUNT.

• ###### 2. Re: how to develop qlikview calculation in tableau

Hi Ajnani

• ###### 3. Re: how to develop qlikview calculation in tableau

Hi,

I too have same calculation with me,

the above calculation have  Creation_Week= , Creation_Quarter=, Creation_Month=,Creation_MonthYear=  like this

but how we will get the same qlikview expression in the tableau? or else is there any alternative calculation please let me know.

• ###### 4. Re: how to develop qlikview calculation in tableau

values are coming in qlikview, because  i have applied this logic =if(sum(invoice_amount)>0,sum(invoice_amount)).

but in the tableau how can we use that logic in the below calculation

IF [Creation Date] <= TODAY()

AND DATEDIFF('year',[Creation Date],Today())= 0 THEN [Invoice Amount] END.

• ###### 5. Re: how to develop qlikview calculation in tableau

Anjani

Find attached link on date functions

Year: Datetrunc("year",[creation-date)

Month: Datetrunc("month", [creation-date)

Quarter: Datetrunc("quarter',[creation-date)

• ###### 6. Re: how to develop qlikview calculation in tableau

Hi Anjani,

Find attached workbook in version 9.3 with YTD calculations.

• ###### 7. Re: how to develop qlikview calculation in tableau

in qlikview, i have applied this logic =if(sum(invoice_amount)>0,sum(invoice_amount)).

but in the tableau how can we use that logic in the below calculation

IF [Creation Date] <= TODAY()

AND DATEDIFF('year',[Creation Date],Today())= 0 THEN [Invoice Amount] END.

your calculation is correct,

but in the amount field values are in negative could you please help me to resolve it

• ###### 8. Re: how to develop qlikview calculation in tableau

Hi Akriti,
I am new to tableau, I have done the same,

but my amount field have negative values that's why i have applied this logic in qlikview =if(sum(invoice_amount)>0,sum(invoice_amount)).

but in the tableau how can we mentioned the same in the ytd calculation.?

• ###### 9. Re: how to develop qlikview calculation in tableau

Hi,
I have given like this

IF [Creation Date] <= TODAY()

AND DATEDIFF('year',[Creation Date],Today())= 0 and [Invoice Amount]>0 THEN

[Invoice Amount]

END

but its not giving any value.

could you please look at once and correct me

• ###### 10. Re: how to develop qlikview calculation in tableau

Anjani,

Please find my approach as reference below

Qlick=if(sum(invoice_amount)>0,sum(invoice_amount)).

Tableau: IF SUM(invoice_amount])>0 THEN SUM(invoice_amount) END