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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator III
Creator III

Data from different tables into one Line chart

Hi,

i have two tables

LOAD SaleDate,

   Sales ;

SQL SELECT Date,

   Sales

FROM Sales;

LOAD MarketingDate,

   MarketAmount ;

SQL SELECT MarketingDate,

   MarketAmount

FROM Marketing;

ImageSale.PNG

i need to display both datas in line chart for Each day without repeating dates, for last 6 months. How could i do this?

7 Replies
shraddha_g
Partner - Master III
Partner - Master III

Link those 2 tables with dates.

LOAD SaleDate as CalendarDate,

   Sales ;

SQL SELECT Date,

   Sales

FROM Sales;

LOAD MarketingDate as CalendarDate,

   MarketAmount ;

SQL SELECT MarketingDate,

   MarketAmount

FROM Marketing;

and then plot graph

Dimension:- Month(CalendarDate)

Measure 1 :- sum(Sales)

Measure2:- sum(MarketAmount)

berryandcherry6
Creator III
Creator III
Author

Hi ,

Thanks for reply!

But i need to display for last 6 months that is OCT 2016 to Feb 2017, showing dates in x axis.

shraddha_g
Partner - Master III
Partner - Master III

Use in Set analysis,

sum({<CalendarDate = {"">=$(=date(addmonths(max(CalendarDate),-6)))}>}MarketAmount)

sum({<CalendarDate = {"">=$(=date(addmonths(max(CalendarDate),-6)))}>}Sales)

In Add Ons section

Uncheck Show Zero Values Property

berryandcherry6
Creator III
Creator III
Author

Hi Shradda,

Yes, i got what i wanted. But i have a questions here

Instead of Month as a dimension, if i use Dates it shows multiple values for same dates. How could i achieve to get only one value for particular dates without repeatation of Dates?.

priyasawant
Creator II
Creator II

Hi

berryandcherry6
Creator III
Creator III
Author

Hi,

Yes, i have done it. But date gets repeated. Beacuse i sales table, there is multiple values for same date. So combining these two table results in Multiple data.

Please find below attached qvf file,

priyasawant
Creator II
Creator II

Hi