In my Qlik Dashboard I have common data from two different systems but the field names are different, like
Two Different Systems are Prod and QA
Prod fields are coming as P_Code, P_Name,P_Address......etc and QA fields are coming as Code, Name, Address......etc I am using all these fields across my dashboard in charts and as filters as well and I have a field called Source which contains Prod and QA, from this when i select Prod all the objects in the dashboard should reflect with the Prod data and same as with QA selection as well.
I know we have several ways to achieve this.Currently I am thinking on below two options.
1) One is using with GetFieldSelctions function/If clause -- This one I have to use on each object
2) Second one is create separate tab for each source and display it conditionally -- Here all the objects will be created twice.
Here i just want to know which option is good in terms of performance. Please let me know if we have any other way to do this.
Use a variable which prepends any field that contains "P_" or nothing, like "" or even Null().
But for the sake of performance, I would load all data in the same fields, and create a new one in the script as "Source" where you store either PROD or QA. Then you can use this flag in the set analysis of the charts to distinguish which data do you want to display.
While it may look like a lot of effort in development, you are saving a lot of space and memory, assuming PROD and QA are equivalent in amounts of data, you are currently loading everything twice. Set analysis is very efficient for this type of filtering, and chances are that especially dimensional data have the same values in both systems and therefore can be stored only once.
It's also best for maintenance, in case there is a new field, you only need to add it in the script and the charts, instead of twice in the script and also twice in each chart.
If I understand you correctly, neither of these options would be best practice and unnecessarily complex.
I would alias the fields so that the names of equivalent fields in the two systems re the same, then concatenate the data. Use the Source field as you have described. Then if you select Prod from source, you will get the results for Prod.
Thank you Miguel for the response, I am bit confused on below could you please elaborate
But for the sake of performance, I would load all data in the same fields, and create a new one in the script as "Source" where you store either PROD or QA.
Thank you for your response Jonathan, Along with the common fields i have some other fields as well which are different between two systems and currently the data model is being joined using left join between Prod and QA and number of fields are also different here and there. So I think i can not do concatenate here.
You don't need to exactly match the fields for a forced concatenation using the Concatenate() load modifier. However, it is hard to say whether concatenation or joining is the better approach without knowing more about your data and the analysis you wish to perform.
In short, what Jonathan is already suggesting: concatenate both tables and use the Source field (or use a more refined one if it does not exist already) in the front-end as a selection or in the expressions (e.g.: set analysis) to decide which data source you want to display.