Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to do further calculations on a created table?

Hi guys,

Fallowing code generates a table called Person, the table iz created but where in the code can i do further calclations? Should i do a resident table so i can use all values qlikview created in the table 'Person'? What is the best method for this?

So i  need to do further calculations efter the table is merged to one table called person?

Person:
LOAD
  Ar_ID & '-' & Clin_ID & '-' & Pat_ID as %Key_ArClinPers,

"Charge_ID";
SQL SELECT "Area_ID",
"Charge_ID",
"Clin_ID",
"Per_ID"
FROM "Trifala_stk03".dbo.Pat;

Right Join (Person)
LOAD "Charge_ID",
Name as Paymentmodell;
SQL SELECT "Charge_ID",
Name
FROM "Trifala_stk03".dbo.ChargeType
Where Charge_ID=20;


TmpMunAssessment:

LOAD
Ar_ID & '-' & Clin_ID & '-' & Pat_ID as %Key_ArClinPers,
Asset_ID,
HomeID_ID as Klin_ID,
SSDN,
IF(ISNULL(Created), 'Tomt', date(Created)) as Created,
DayStart(Signed) as Date,
IF(ISNULL(Signed), 'Tomt', Signed) as Signed,
IF( ISNULL(Cancelled), 'Tomt', Cancelled) as Cancelled,
YEAR(Signed) as År
Where ISNULL(Cancelled) AND NOT ISNULL(Signed);
SELECT
Ar_ID,
Clin_ID,
Pat_ID,
Asset_ID,
HomeID_ID,
SSDN,
Created,
Signed,
Cancelled
FROM Assessment;


Left Join (TmpMunAssessment)
LOAD
Asset_ID,
IF(ISNULL(Override), IF(ISNULL(Value), -1, Value), Override) as ChangedPGValue,
if(IF(ISNULL(Override), IF(ISNULL(Value), -1, Value), Override)=Override,Value) as PGValue;
SELECT
Asset_ID,
Override,
Value
FROM Calculation
WHERE CalculationIdentifier=14;

Left Join (TmpMunAssessment)
LOAD
Asset_ID,
IF(ISNULL(Override), IF(ISNULL(Value), -1, Value), Override) as ChangedKValue,
if(IF(ISNULL(Override), IF(ISNULL(Value), -1, Value), Override)=Override,Value) as KValue;
SELECT
Asset_ID,
Override,
Value
FROM Calculation
WHERE CalculationIdentifier=7;

Right JOIN (Person)
PGKaries:
//LOAD
//*
//Where KValueColor='Red';
Load
*,
If(ChangedKValue=1,'Green',if(ChangedKValue=2,'Yellow', 'Red')) as KValueColor
;
LOAD
%Key_AreaClinicPerson,
Asset_ID,
Klin_ID,
SSDN,
Created,
Date,
Month(Date) as Månad,
Cancelled,
Year,
PGValue,
ChangedPGValue,
ChangedKValue,
KValue,
Signed
Resident TmpMunAssessment
Order BY SSDN, Signed desc;


DROP Table TmpMunAssessment;

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You need a resident load to create a new table that contains the extra calculations. Or you could first store the Person table to a qvd file and load the new table from the qvd file instead of using a resident load. In some cases that may perform better than a resident load.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You need a resident load to create a new table that contains the extra calculations. Or you could first store the Person table to a qvd file and load the new table from the qvd file instead of using a resident load. In some cases that may perform better than a resident load.


talk is cheap, supply exceeds demand
Not applicable
Author

Ok thanks il try that.