Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate cost for Two different ranges

Hi all,

I'm new to qlikview and currently struck with a complicated scenario.

1) I'm building a straight table with different dimensions like Database_Name, Region, Employees, Criticality, then I'm writing two expressions to get Users and Servers to count numbers of servers and users on each Database.

   

DatabaseRegionUsersServersCriticalityCost
megudAsia52Non-Critical
wejgufEurope286Critical
nhujgerMiddle East6010Non-Critical
segyuiAsia9015Critical
loranuEurope12030Non-Critical

I was given this small table to caluclate the cost to maintain that database.

ServersServersServersServersServersServersServersServersServersServers
Users135791317253349
11 tiny2*tiny3*tiny2 Small3 Small2 Medium3 Medium2 Large3 Large4 Large
92*tiny2*tiny3*tiny2 Small3 Small2 Medium3 Medium2 Large3 Large4 Large
153*tiny3*tiny3*tiny2 Small3 Small2 Medium3 Medium2 Large3 Large4 Large
212 Small2 Small2 Small2 Small3 Small2 Medium3 Medium2 Large3 Large4 Large
253 Small3 Small3 Small3 Small3 Small2 Medium3 Medium2 Large3 Large4 Large
392 Medium2 Medium2 Medium2 Medium2 Medium2 Medium3 Medium2 Large3 Large4 Large
553 Medium3 Medium3 Medium3 Medium3 Medium3 Medium3 Medium2 Large3 Large4 Large
732 Large2 Large2 Large2 Large2 Large2 Large2 Large2 Large3 Large4 Large
1053 Large3 Large3 Large3 Large3 Large3 Large3 Large3 Large3 Large4 Large
1504 Large4 Large4 Large4 Large4 Large4 Large4 Large4 Large4 Large

4 Large

CriticalityAreaMiddle EastEuropeASIA
tiny132.08180.82113.23
Non-Criticalsmall204.38217.60246.93
medium348.98391.16314.33
Large438.18538.28449.13
tiny123.65185.39152.30
Criticalsmall234.09254.61294.00
medium354.97393.05367.40
Large496.73469.93454.20

Example - If my number of Users are 5 and servers are 2 for a database then I need to look at ranges which gives me 2 times the tiny,

Then I need to look at region and Criticality. If it is non critical then I need to show non critical vale for Asia which is 2*246.93 for this example.

Appreciate your help,

Larry.

2 Replies
Not applicable
Author

please give me an advice on how to solve this issue. Any help is appreciated.

ahaahaaha
Partner - Master
Partner - Master

Hi,

It became interesting to work with your task.

The attached file describes the approach to the solution. All comments in the script code. Most of the code is converting the average cross-table into a simple one. Perhaps it makes sense to ask him right away in another form.

For analysis, all the code can be commented out, and then consistently remove comments as the tables load.

Hope this helps you a bit.

Regards,

Andrey