Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a strange requirement and wanting to see if anyone has a better solution to do this in the Qlik Sense load script rather than the front end because we might want to reuse this at multiple places.
Scenario:
I have a table with values as below:
I need to calculate performance as total of all payments for a department (irrespective of the month) + credit for the month the user selects (max month).
Example: When user selects Jan 2025, Department A needs to have a total of all payments + Credit value for the month the user selected
In this case it would be
Department A (Jan 2025) - 7800 + 100 = 8800
Is this even a possible thing to do in Qlik Sense?
I think I might have a couple solutions based on your table. It looks like front-end or the master measure would make the most sense since the script option would still require you to add the expression as a measure.
1. Just front-end in your measure, or create as master measure to re-use in other apps
SUM({<Department=>} TOTAL [Payments]) + SUM([Credit])
2. In Script
MonthlyPayments:
LOAD
Month,
SUM(Payments) AS TotalPayments_Month
RESIDENT YourTable
GROUP BY Month;
LEFT JOIN (YourTable)
LOAD
Month,
TotalPayments_Month
RESIDENT MonthlyPayments;
Measure in table
SUM(TotalPayments_Month) + SUM(Credit)
I think I might have a couple solutions based on your table. It looks like front-end or the master measure would make the most sense since the script option would still require you to add the expression as a measure.
1. Just front-end in your measure, or create as master measure to re-use in other apps
SUM({<Department=>} TOTAL [Payments]) + SUM([Credit])
2. In Script
MonthlyPayments:
LOAD
Month,
SUM(Payments) AS TotalPayments_Month
RESIDENT YourTable
GROUP BY Month;
LEFT JOIN (YourTable)
LOAD
Month,
TotalPayments_Month
RESIDENT MonthlyPayments;
Measure in table
SUM(TotalPayments_Month) + SUM(Credit)