Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I am newbie in Qlik. I would like to ask a question about set analysis and conditional calculations for different dimensions.
For example,
I have 2 different buildings and each building has energy analyzers to track the main energy inlet and track the consumption points whose data stored in same database. I want to calculate each building's total inlet energy and put the buildings as dimensions (x-axis) and consumptions as measure (y-axis) in a bar chart.
When I create Master Item with set analysis for each building (as follows), my problem is not solved when I visulaize the data with any chart. What is the best option to identify the energy analyzers as inlet analyzers and visualize them?
Code which is not worked when I identify two different Master Items
MasterItem1 = Sum({<[Building Name] = {'Building-A'}, [Analyzer_Name] = {'Energy Analyzer_1'}>} Energy) +
Sum({<[Building Name] = {'Building-A'}, [Analyzer_Name] = {'Energy Analyzer_2'}>} Energy)
MasterITem2 = Sum({<[Building Name] = {'Building-B'}, [Analyzer_Name] = {'Energy Analyzer_3'}>} Energy) +
Sum({<[Building Name] = {'Building-B'}, [Analyzer_Name] = {'Energy Analyzer_4'}>} Energy) +
Sum({<[Building Name] = {'Building-B'}, [Analyzer_Name] = {'Energy Analyzer_5'}>} Energy)
I would recommend that in your data model you differentiate between inlet and outlet to make it simpler to do your calculations.
In your Script, create an extra field, Type and use a condition such as ..
If(Right(Analyzer_Name, 1)<6, 'Inlet', 'Outlet') as Type
This will allow you to use Type in Set analysis to create your measures simpler.