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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
awalhashim
Contributor II
Contributor II

num function

Hi all,

based on my code, which part is wrong when i tried to change the format of number.

 

=If(Bookings.Event = 'Sign' and Type='Digital',
Num(sum({<Source__c=>}
if(SystemMapping.Group = Interest.Business_Unit,
if(CreatedDate < EventDate,
if(EventDate-CreatedDate > 0
and EventDate-CreatedDate < 365
Aggr(Only({<SaleID = e({1<Bookings.Event = {'Return'}>})>}SellingPrice),saleid),'RM #,##0.0 mil;(RM #,##0.0) mil'))))))

 

I tried to find a way but is not working

Labels (1)
2 Replies
anushree1
Specialist II
Specialist II

Could you try this,

=If(Bookings.Event = 'Sign' and Type='Digital',
Num(
if(SystemMapping.Group = Interest.Business_Unit,
if(CreatedDate < EventDate,
if(EventDate-CreatedDate > 0
and EventDate-CreatedDate < 365
Aggr(Only({<SaleID = e({1<Bookings.Event = {'Return'},Source__c=>})>}SellingPrice),saleid),'RM #,##0.0 mil;(RM #,##0.0) mil'))))))

pasi_lehtinen
Partner - Contributor III
Partner - Contributor III

Hi,

Your issue is related to the parantheses mostly. Anyways, you could also simplify your expression. Please try:

=num(
	If(
    	Bookings.Event = 'Sign' and Type='Digital'
		and SystemMapping.Group = Interest.Business_Unit
		and CreatedDate < EventDate
		and (EventDate-CreatedDate) > 0
		and (EventDate-CreatedDate) < 365,
		sum({<Source__c=>} Aggr(Only({<SaleID = e({1<Bookings.Event = {'Return'}>})>}SellingPrice),saleid))
	)
,'RM #,##0.0 mil;(RM #,##0.0) mil')

Also, this one could further be simplified by inserting all those if statements into the set analysis.