Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field [Max_Invoice_Date_GMT_Updated] that has dates stored for each [Company_Code] as shown below
Now, I want to sum my [Quantity] where [Invoice_Date_GMT_Updated] = [Max_Invoice_Date_GMT_Updated] using set analysis.
I wrote - Sum({<[Invoice_Date_GMT_Updated] = p(Max_Invoice_Date_GMT_Updated)>}Quantity)
but unfortunately, I am not getting the correct values. I don't want to use it because my data is too large and it might affect my performance.
Please help.
Hi,
You can try to do this at script level like below to avoid performance hit on the application
MAP:
mapping load
company_code, max([Invoice_Date_GMT_Updated]) as [Invoice_Date_GMT_Updated]
from CompanyTable;
Company:
Load *, if ([Invoice_Date_GMT_Updated] =MaxDate,1,0) as Max_Flag;
Load *,
applymap('MAP',company_code ,'N/A') as MaxDate
from CompanyTable;
Chart expression: sum({<Max_Flag={'1'}>}Quantity)
Thanks,
Sasi
Hi,
You can try to do this at script level like below to avoid performance hit on the application
MAP:
mapping load
company_code, max([Invoice_Date_GMT_Updated]) as [Invoice_Date_GMT_Updated]
from CompanyTable;
Company:
Load *, if ([Invoice_Date_GMT_Updated] =MaxDate,1,0) as Max_Flag;
Load *,
applymap('MAP',company_code ,'N/A') as MaxDate
from CompanyTable;
Chart expression: sum({<Max_Flag={'1'}>}Quantity)
Thanks,
Sasi