Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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
Highlighted

How about if you use Date() function around them

=Date(
    If(ARTransactionCode = 20, (TC.ARInvoiceDate), (ARInvoiceDate))
)
Highlighted
Contributor III
Contributor III

Hi Sunny,

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

 

regards,

Brian

Highlighted
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.

Highlighted
Contributor III
Contributor III

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

Thanks for the reply.