Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
What is the use of alt function? Give one example?
Thanks in Advance
Alt belongs to Conditional function (like extended IF function) returning first numerical value.
In this case 1 is returned
in this 2
and so on..
If no number is found the last value is returned:
Hi,
Please refer this:
alt(case1[ , case2 , case3 , ...] , else)
The alt function returns the first of the parameters that has a valid number representation. If no such match is found, the last parameter will be returned. Any number of parameters can be used.
Example:
alt( date#( dat , 'YYYY/MM/DD' ),
date#( dat , 'MM/DD/YYYY' ),
date#( dat , 'MM/DD/YY' ),
'No valid date' )
Will test if the field date contains a date according to any of the three specified date formats. If so, it will return the original string and a valid number representation of a date. If no match is found, the text 'No valid date' will be returned (without any valid number representation).
Hi
Go through the below posts:
http://qlikshare.com/using-alt-function-qlikview/
http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/25/which-conditional-functions-do-you-use
Regards
Av7eN
Alt belongs to Conditional function (like extended IF function) returning first numerical value.
In this case 1 is returned
in this 2
and so on..
If no number is found the last value is returned:
Hi @prabhas v
Check this THREAD below
Which conditional functions do you use?
In this Thread Use of ALT Function is Explained in detail check this
Thanks & Regards
NK
Hi,
It is similar to NVL() in Oracle, ISNULL() in SQL Server.
If the first parameter returns null then the second parameter value is assigned.
Alt(Sum(Sales), 0)
If Sum(Sales) is null then 0 is returned
Alt(Only(Year), Year(Today())) - If Only(Year) returned null then Current year is assigned to it.
Also you can multiple levels in this which is similar If-elseif-else or Case statement
alt( date#( dat , 'YYYY/MM/DD' ),
date#( dat , 'MM/DD/YYYY' ),
date#( dat , 'MM/DD/YY' ),
'No valid date' )
Regards,
Jagan.
Hi Robert,
I have a scenario that i need to convert the if condition expression into Alt finction
if(IF(GetFieldSelections(Earlypayment) = 'NEFT' AND Payment_Discount<>0 ,1,0)=1, Discountperday * PaymentFunds ,0)
I tried like this,
=Alt(IF(GetFieldSelections(Earlypayment) = 'NEFT' AND Payment_Discount<>0 ,1,0)=1, Discountperday * PaymentFunds ,0)
chk dis
Nice Explanation...
I like this
Very Nice Explanation.