Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Report with help of 2 tables and conditions

Hello All

I have 2 tables, OLD and NEW:

IN OLD DATA TABLE as below , where there are some BID's  and Staus is Confirm and certain amount .

In NEW DATA  TABLE for some of the BID's of Old table status becomes Cancelled and amount becomes 0.

For few the amount changes whereas status remains same.

I want a report as 3rd table --which is REQUIRED OUTPUT Table

If Status gets Cancelled then replace 0 by (AMOUNT of OLD Table) *-1  and  if status is confirmed then keep the AMOUNT of NEW DATA Table in the report .

Kindly help how this can be achieved.

OLD DATA TABLE

   

BIDDATESTATUSAMOUNT
BK12320-02-2018CONFIRM10000
BK38722-02-2018CONFIRM5000
BD25525-02-2018CONFIRM4580
CH99927-02-2018CONFIRM3636

                                                                                                                                  

NEW DATA TABLE

    

BID

DATESTATUSAMOUNT
BK12315-03-2018CANCELLED0
BK38722-02-2018CONFIRM5400
BD25521-03-2018CANCELLED0
CH99927-02-2018CONFIRM3636

REPORT -REQUIRED OUTPUT

    

BIDDATESTATUSAMOUNT
BK12315-03-2018CANCELLED-10000
BK38722-02-2018CONFIRM5400
BD25521-03-2018CANCELLED-4580
CH99927-02-2018CONFIRM3636

Thanks & Regards

Chintan Gala

4 Replies
olivierrobin
Specialist III
Specialist III

hello

i would JOIn the 2 table first

so, you have new and old values on the same row

and then make the calculations as desired to have the 3rd table

Anonymous
Not applicable
Author

Dear Oliview

Thanks for your reply.

I have joined the tables. I am able to get Amount of OLD TABLE.

As soon as I use the if condition , STATUS is CANCELLED to get sum in Report , there is no data.

Regards

Chintan Gala

olivierrobin
Specialist III
Specialist III

could you post your code ?

Anonymous
Not applicable
Author

Hello Olivier

Thanks for your help. I am able to get the result by joining the tables and using Flags in each table.