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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
kakaderanjit53
Creator III
Creator III

Custom function Issue

Here My scenario is Create Custom Fuction to show values in Crores,Lacs,Thousands etc for that purpose

I Have Been Created One Variable in Script Level i.e

SET FormatNumber=Dual(

    if($1>=10000000,num($1/10000000,'₹ ##.##Cr'),

if($1>=100000,num($1/100000,'₹ ##.##L'),

if($1>=1000,num($1/1000,'₹ ##.##K'),

$1))) ,$1);

I Have Been Created One Variable in Frontend i.e  vCondition this variable contains expression like below

if(Measures='Logins',$(vTotalLogins),
if(Measures='Clients Traded (Unique)',$(vUniqueClientsTraded),
if(Measures='Volume (Cr)',$(vTotalVolume),
if(Measures='Brokerage in Lacs (Gross)',$(vBrokerage),
if(Measures='No. of Trading Days',$(vNoftradingdays),
if(Measures='Avg. brokerage per client',$(vAvgClientBrokerage),
if(Measures='Avg. daily login',$(vAvgDailyLogins),
if(Measures='Avg. daily brokerage',$(vAvgDailyBrokerage),
if(Measures='Avg. daily volume',$(vAvgDailyVolume)
)))))))))

here I am passing vCondition as a parameter to FormatNumber like below

$(FormatNumber($(vCondition)))

But I unable to get the expected result .

Hello Qlik Experts,

Please provide me the correct solution to overcome the above problem.

Help me asap

avinashelite

mto

lakshmikandh

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Ranjit,

I'd suggest two improvements:

1. Start the formula in vCondition with the equal sign, in order to pick the relevant formula before the expression gets to the Chart Measure - that means that Measures cannot be your chart Dimension, but it will largely improve performance.

2. The parameter to the $-sign expansion needs to be enclosed in single quotes, to appear as a string:

$(FormatNumber('$(vCondition)'))

I believe that these two changes should fix the problem, however everything needs to be tested 🙂

We teach these advanced techniques at the Masters Summit for Qlik - check our upcoming schedule and see if our agenda is good for you.

Cheers,

Oleg Troyansky

Upgrade your Qlik Skills with my book QlikView Your Business: An Expert Guide to Business Discovery with QlikView and Qlik Sense

Ask me about Qlik Sense Expert Class!
kakaderanjit53
Creator III
Creator III
Author

Hi,

Thanks for your important reply,

Let me check now,as per your above suggestion.