Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
khasimvali85
Creator II
Creator II

line chart

Hi Community,

i am not able to design line chart and Bar Chat can anyone give me the suggestions?

i have table fields like Date, Quantity, Product, Factory and i want to design Line chart and Bar Chart as attached QVW file.

i want to show date field as a dimension like current Month(June-15), Previous Month(May-15), Last year Current Month(June-14).

how do i achieve this ? can anyone suggest me?

Regards,

Khasim.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Corrected v2.

PFA

Dim: MonthName(DATE)

Expression:

=SUM({<DATE={'>=$(=MonthStart(Addmonths(Max(DATE),-1))) <=$(=date(Max(DATE)))'}>+<DATE={'>=$(=MonthStart(Addmonths(Max(DATE),-12))) <=$(=MonthEnd(Addmonths(Max(DATE),-12)))'}>}QTY)

View solution in original post

5 Replies
tresesco
MVP
MVP

Corrected v2.

PFA

Dim: MonthName(DATE)

Expression:

=SUM({<DATE={'>=$(=MonthStart(Addmonths(Max(DATE),-1))) <=$(=date(Max(DATE)))'}>+<DATE={'>=$(=MonthStart(Addmonths(Max(DATE),-12))) <=$(=MonthEnd(Addmonths(Max(DATE),-12)))'}>}QTY)

khasimvali85
Creator II
Creator II
Author

Hi Tresesco,

Thanks for giving me the solution but what happen is the data is showing in line chart is "no data to display" and

given expression is not working in my application.

Regards,

khasim.

tresesco
MVP
MVP

Check if the field names are correct and other possible errors. it's always better to understand the expression and logic that is suggested; that helps you learn and accomodate as per your requirement. I have already showed using your shared sample qvw. If still it doesn't work, you might want to invetigate yourself a bit more, or, come up with a sample qvw that is not working.

khasimvali85
Creator II
Creator II
Author

Hi Tresesco,

whenever using huge data the script will not work, i am going to calculate a percentage.

please find the below my expression.

=(sum({<link_Date={'>=$(=Addmonths(Max(link_Date),-1)) <=$(=date(Max(link_Date)))'}>+<link_Date={'>=$(=Addmonths(Max(link_Date),-12)) <=$(=MonthEnd(Addmonths(Max(link_Date),-12)))'}, [Fiscal Year]={$(=Max([Fiscal Year]))},[Production MonthYear]=,[Call Detail Flag]=,[OccurenceP MonthYear]=,OccurencePMonth=,OccurencePYear=,

ProductionMonth=,ProductionYear=,[FCR 12 Months Flag]={'FCR_12'}>}[FCR Complaint Count])/

sum({<link_Date={'>=$(=Addmonths(Max(link_Date),-1)) <=$(=date(Max(link_Date)))'}>+<link_Date={'>=$(=Addmonths(Max(link_Date),-12)) <=$(=MonthEnd(Addmonths(Max(link_Date),-12)))'},[Fiscal Year]={$(=Max([Fiscal Year]))},[Wt Sales Flag]={'Wt_Sales'},[Production MonthYear]=,[OccurenceP MonthYear]=,OccurencePMonth=,OccurencePYear=,AnalysisType = ,

[Call Detail Flag]=,ProductionMonth=,ProductionYear=,PartCoding=,[Part Flag]=>}[Wt Sales Qty]))*100

the above script will not work, i am calculating the percentage of FieldCallRate=[FCR Complaint Count])/[Wt Sales Qty]

please give any suggestion.

Regards,

Khasim.

khasimvali85
Creator II
Creator II
Author

Hi, Tresesco,

its working fine thanks a lot.