Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Alt() function giving output as Null in text object?

Hi ,

Im trying Alt() function in text object but it is giving null in output.

I have 3 different date formats in excel and want to make dates only in one format using alt().

How to do this?

I have attached my qvw file.Please check it .

Thanks in advance.

7 Replies
qlikmsg4u
Specialist
Specialist

Text box holds only one value,not individual rows.

try this

=date(Alt(

Date#(MixDate,'MM/DD/YY'),

Date#(MixDate,'MM-DD-YYYY'),

Date#(MixDate,'DD-MM-YYYY')

),'DD-MM-YYYY')

select one date from list box

swuehl
MVP
MVP

I think your first argument's date format needs to be adapted to your data set, and an additional Date() function reformats to a common default format:

=Date(

Alt(

Date#(MixDate,'M/DD/YY'),

Date#(MixDate,'MM-DD-YYYY'),

Date#(MixDate,'DD-MM-YYYY')

))

This works in your text box, when you select a single field value.

PrashantSangle

Hi,

Try this,

=date(Alt(

Date#(MixDate,'MM/DD/YY'),

Date#(MixDate,'MM-DD-YYYY'),

Date#(MixDate,'DD-MM-YYYY')

),'DD-MM-YYYY')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
satishkurra
Specialist II
Specialist II

PFA

sushil353
Master II
Master II

Hi,

Alt function will return the valid number representation. in your case all the no format are valid so that is why it will give all the formats based on the selection.  you can visualize that as

=concat(AltDate#(MixDate,'DD/MM/YY'),
Date#(MixDate,'MM-DD-YYYY'),
Date#(MixDate,'DD-MM-YYYY')
),' ')

USE Date(AltDate#(MixDate,'DD/MM/YY'),
Date#(MixDate,'MM-DD-YYYY'),
Date#(MixDate,'DD-MM-YYYY')
)
)

Not applicable
Author

Thanks Max dreamer .Its working.

PrashantSangle

Welcome

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂