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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
danihs
Contributor
Contributor

Count lines and compare to quantities in another field

Hello,

I have a table "A" and a table "B", both containing dates.

Table A

DateCountryForecast qty
dd.mm.yyyyx33

 

Table B

datecountry 
dd.mm.yyyyx 

 

The actuals are the number of lines in table B and the forecasts are the quantities per line in its correspondent field in table A. I can use the month and country to link both tables but I cannot get to put "forecasts" (sum) and "actuals" (count of lines in table B) in the same table to be able to compare them in graphs.

I am new to Qlik Sense so your help is very appreciated!

Thank you

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The data does not have to be in the same table, the tables will be linked by common fieldname(s).  From the chart perspective, it's one big joined table. 

Make a chart, for example a table chart. Use Month and Country as Dimensions. 

1st Measure: Sum([Forecast qty])

2nd Measure: You will need field unique to TableB to count. If you have a such a field, you can get the count of lines in TableB as "count(fieldname)".  If you don't have a suitable field, you can create one in the load script by adding the following to the Load statement for TableB.

1 as Actual

and then "sum(Actual)" in your chart. 

 

View solution in original post

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The data does not have to be in the same table, the tables will be linked by common fieldname(s).  From the chart perspective, it's one big joined table. 

Make a chart, for example a table chart. Use Month and Country as Dimensions. 

1st Measure: Sum([Forecast qty])

2nd Measure: You will need field unique to TableB to count. If you have a such a field, you can get the count of lines in TableB as "count(fieldname)".  If you don't have a suitable field, you can create one in the load script by adding the following to the Load statement for TableB.

1 as Actual

and then "sum(Actual)" in your chart.