Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
elixirsol
Contributor
Contributor

Not able to produce bar graph with date factor

Hi,

I am trying to plot a bar graph with Product as dimension and Backlog as measure. I am not able to produce a bar graph with the date factor in the Backlog query. The query is as follows: sum ( {<Sales_Order_Date = {"<=$(=vDate)"}, SO_Order_Backlog_Flag = {1},In_Out = {"Out"}, SO_Order_Status = {'Completed'} >} SO_Product_Amt)

Although, I am able to get the chart if I remove the date factor.

Pls help.

1 Solution

Accepted Solutions
marcus_sommer

Try this:

LET vDate = date(date#('15-Feb-2017', 'DD-MMM-YYYY'), 'FormatFromSalesOrderDate');

sum ( {<Sales_Order_Date = {"<='$(vDate)'"}, SO_Order_Backlog_Flag = {1},In_Out = {"Out"}, SO_Order_Status = {'Completed'} >} SO_Product_Amt)

- Marcus

View solution in original post

4 Replies
marcus_sommer

I think that your date-variable won't be correctly interpreted - to check this change your chart into a table-chart and remove a possible label for this expression and then take a look on the lable-field in which qlik displayed how the expression-parts are evaluated (you might need another dummy-expression like = 1 therewith the chart contained data through a working expression).

- Marcus

elixirsol
Contributor
Contributor
Author

Hi Marcus,

Thanks for your prompt response. However, I'm unable to plot the graph in QlikSense. The Set Analysis works fine in QlikView.

I'm creating the variable like this in the script.

LET vDate = Date#('15-Feb-2017');

marcus_sommer

Try this:

LET vDate = date(date#('15-Feb-2017', 'DD-MMM-YYYY'), 'FormatFromSalesOrderDate');

sum ( {<Sales_Order_Date = {"<='$(vDate)'"}, SO_Order_Backlog_Flag = {1},In_Out = {"Out"}, SO_Order_Status = {'Completed'} >} SO_Product_Amt)

- Marcus

elixirsol
Contributor
Contributor
Author

Thanks a lot Marcus. It worked.