Is it better to calculate KPIs from a script level and store KPIs in a fact table OR calculate KPIs inside UI using Set Analysis ?
Well, generically speaking, I would recommend to store KPIs in the script level - for example, in a qvd layer - and then use it when you load the script of your qvw dashboard.
Nevertheless, if the amount of data is not relevant, it should be fine using set analysis.
KPI is an expression / formula used to calculate a value that usually change when the user click (filter)
IMHO better to define it in the user interface as an expression
Dimensions and Measures
Retrieving data ...