Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Brip51
Creator
Creator

If Statement changes date format

Hi,

I have to two date fields, ARInvoiceDate and TC.ARInvoiceDate.  They are formatted as dates in the load script.

I use them in an IF statement in the APP- 

=if(ARTransactionCode = 20, (TC.ARInvoiceDate), (ARInvoiceDate))

That becomes a column in a table called Invoice Date.  

The problem I have is that when the table is exported to excel, Invoice Date exports as text.  The individual fields TC.ARInvoiceDate and ARInvoiceDate export as dates when I use them as columns on their own.  When I use them in the above IF statement somehow the format changes to text.  I have tried formatting as a dates in the if statement, but nothing seems to work.  I am not sure what I am missing on this.

Any help would be greatly appreciated.

 

Thanks,

Brian

4 Replies
sunny_talwar

How about if you use Date() function around them

=Date(
    If(ARTransactionCode = 20, (TC.ARInvoiceDate), (ARInvoiceDate))
)
Brip51
Creator
Creator
Author

Hi Sunny,

Thanks for the reply. I tried it, but no luck.  It still exports as text.

 

regards,

Brian

trdandamudi
Master II
Master II

I tried using two types of expressions and it is showing as date in Excel (The second option):

Dates_QlikSense.PNG

I am using Qliksense Enterprise June version.

Brip51
Creator
Creator
Author

I tried option 2, but it still exports as text for me.  I am at a complete loss.

Thanks for the reply.