Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
singhcv123
Contributor
Contributor

division calculation in qlikview

I have 2 table from there i want to calculate divisio of 2 values to find out #.

Table 1 :

KPI Code

Booking id  as Repeat Booking Id

where repeat booking =Y

Table 2:

KPI Code

Booking Id as Total Booking

now i want for same KPI code      Repeat Booking /Total Booking

kindly suggest the way to fulfill the same.

3 Replies
tresesco
MVP
MVP

Try like:

Table1:

load

KPI Code,

Booking id  as Repeat Booking Id From<>

where repeat booking =Y

Join

Table 2:

load

KPI Code,

Booking Id as Total Booking From <>:

Final:

load *,

       [Repeat Booking] /[Total Booking] as DivResult

Resident Table1;

Drop Table Table1;

singhcv123
Contributor
Contributor
Author

my code is like below:

Repeat_ArriverAll:

load 14 AS [KPICode],

  [Financial Year],

  [Period Code],

  KeepChar([Period Code],'1234567890') AS [New Period Code],

  [Village Code] as [Channel Type Name],

  [Count] as [Repeat Count]

Resident ArrivalRepeatvisit;

join

load 14 AS [KPICode],

  [Financial Year],

  [Period Code],

  KeepChar([Period Code],'1234567890') AS [New Period Code],

  [Village Code] as [Channel Type Name],

  [Count] as [Total Count]

Resident ArrivalAll;

Repeat_Arriver%:

LOAD *,

  NUM([Repeat Count ]/[Total Count],'#,##0.00%') as Count

  RESIDENT Repeat_ArriverAll;

DROP TABLE Repeat_ArriverAll;

while running this code as suggested by you it showing an error that Repeat Count field don't found.

Anil_Babu_Samineni

Can you post Error screen OR Try this, I just deleted space

Repeat_Arriver%:

LOAD *,

NUM([Repeat Count]/[Total Count],'#,##0.00%') as Count

  RESIDENT Repeat_ArriverAll;

instead of

Repeat_Arriver%:

LOAD *,

  NUM([Repeat Count ]/[Total Count],'#,##0.00%') as Count

  RESIDENT Repeat_ArriverAll;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful