Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have fields called customer_code and sales_group and I have Sum(Grosssale) and Sum(netSale).
So I want to write an expression that if sale_group = ‘Gen’ , ‘Inst’, ‘imp’ and customer_code which start with ‘NP*’
then I want Sum(Grosssale) otherwise I want Sum(netSale).
Thanks
Hi,
Try expression as,
If(Match(sale_group, ‘Gen’,‘Inst’,‘imp’ ) and WildMatch(customer_code,‘NP*’), Sum(Grosssale), Sum(netSale))
may be this?
=if(Sales_Group='Gen' or Sales_Group='Inst' or Sales_Group='Imp' and Customer_Code like 'NP*',
Sum(GrossSales), Sum(NetSale))
Hi Tamil,
Thanks for response.
Your expression getting write output in straight or pivot table when one or more dimension with customer_code but when I removed customer_code from dimension then the output is not giving Sum(Grosssale) its giving Sum(NetSale)
Thanks
Hi
Try like this
In Script,
If(Match(sale_group, ‘Gen’,‘Inst’,‘imp’ ) and WildMatch(customer_code,‘NP*’), GrossSales, NetSale) AS Sales
Then in your expression, simply use Sum(Sales)
try this
Sum(if(match(sale_group, ‘Gen’,‘Inst’,‘imp’ ) and wildmatch(customer_code,''NP*'),Grosssale,netSale)
In that case,
If(Sum({<sale_group={'Gen','Inst','imp'},customer_code={'NP*'}>}Grosssale)=0,
Sum(netSale),
Sum({<sale_group={'Gen','Inst','imp'},customer_code={'NP*'}>}Grosssale))
Hi,
Try like this
If(MixMatch(sale_group, ‘Gen’ , ‘Inst’, ‘imp’) AND customer_code LIKE ‘NP*’, Sum(Grosssale), Sum(netSale))
Hope this helps you.
Regards,
Jagan.
sum({<Sales Group='Gen'>} Gross sales)
write the expression in this way want you want the values required in column
Did you try what I suggested you?
You can replace And operator with OR for same