Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use aggr() function to get total once for each key. The total is correct for each key, but they are not in the right position in a pivot table
I attached a test qvw.
Could anyone help with that? thanks.
Add the nodistinct qualifier to the aggr function. See attached example.
Looks like this one works:
sum(
if(date2=aggr(min(date2),key, date1),aggr((sum(amount)),key))
)
Hi,
It was getting sorted using date.
Changed the sort priority to be sorted using Key and then your 2nd expression value.
See if it helps.
Regards,
Abey
Hi Michael,
Thanks for reply. It works in the test app. But when I use the formula in my real app, it fails. I attached my real app. Please take a look. Many thanks.
Add the nodistinct qualifier to the aggr function. See attached example.
Thanks G and all of you.
Problem solved.