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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahi_9833
Contributor
Contributor

Unable to show the bar chart without selection

Hello all,

I have implemented one bar chart with below expression using set analysis.

Sum({<filter1={'India'}, Filter2={'forecast'}, Filter3={">=$(=date(today()) -7) <=$(=date(today()))"}>Sales)

But the graph is showing empty until I select the filter as forecast. 

Please suggest, how we can show bar graph without selecting filter.

Thanks in advance for your help.

6 Replies
hic
Former Employee
Former Employee

First, everything is case sensitive. Is your "filter1" really lower case while "Filter2" is capitalized?

Secondly, you have a bracket wrong. It should be

">=$(=date(today() -7)) <=$(=date(today()))"

not

">=$(=date(today()) -7) <=$(=date(today()))"

Thirdly, you miss a curly bracket at the end of the set expression. It should be

..."}>}

not

..."}>

Mahi_9833
Contributor
Contributor
Author

Thank you for the reply.

Sorry for miscommunication. Let me give you original expression I'm trying to achieve.

Attached screenshot with whole expression. 

Logic:  Depending on the input box variable(vDay), the bar chart should show the Predicted data bars in the chart without any selection of filters.

example:

if vDay=2, the graph should show 01-12-2022 and 02-12-2022 bars

if vDay=5, the graph should show from 01-12-2022 to 04-12-2022 and 12-12-2022 bars

 

Table:

Prediction Date Incident count AIML_Type Label
26-11-2022 1 Prediction Actual
27-11-2022 5 Prediction Actual
28-11-2022 3 Prediction Actual
29-11-2022 6 Prediction Actual
30-11-2022 7 Prediction Actual
01-12-2022 8 Prediction Predicted
02-12-2022 10 Prediction Predicted
03-12-2022 11 Prediction Predicted
04-12-2022 12 Prediction Predicted
05-12-2022 14 Training Predicted
06-12-2022 15 Training Predicted
07-12-2022 16 Training Predicted
08-12-2022 17 Training Predicted
09-12-2022 19 Training Predicted
10-12-2022 20 Training Predicted
11-12-2022 21 Training Predicted
12-12-2022 23 Prediction Predicted

 

Please check and suggest the solution/expression to use in Bar graph with Prediction date as dimension.

Thanks in advance.

 

hic
Former Employee
Former Employee

You have
[Prediction Date]={"=$(Date(Min(PredDate),'MM/DD/YYYY'))<=$((Date(Min(PredDate),'MM/DD/YYYY'))+vDay)"}

First of all, a dollar expansion needs either a variable reference or an expression with a leading equals sign. You have neither. So, adding the equals signs and removing an unecessary pair of brackets, we get
[Prediction Date]={"=$(=Date(Min(PredDate),'MM/DD/YYYY'))<=$(=Date(Min(PredDate),'MM/DD/YYYY')+vDay)"}

Further, the Date() functions are not necessary. You need them only if you make a search on the field values, but here it is an expression search with a simple numeric comparison. So I'll remove them too:
[Prediction Date]={"=$(=Min(PredDate))<=$(=Min(PredDate)+vDay)"}

Try the above and see what happens.

PS You have [Prediction Date] to the left, and [PredDate] to the right. Are these the same?

Mahi_9833
Contributor
Contributor
Author

Thank you for the reply.

But the solution is not working. 

I have selected next 5 days prediction, but it is showing all predicted values.

attached screen for reference. 

Please help me on this.

[Prediction Date] and PreDate both are same.

Dianah
Contributor
Contributor

Kindly check if you have the latest office version installed. To install the latest updates, open the Excel app > Go to File > Account > Under Product Information, click on "Update Options" > Select "Update Now". If the problem still persists, I would suggest you to run a "Quick Repair" and see if it fixes the issue

 

Regards,

Will

Mahi_9833
Contributor
Contributor
Author

Hello Dianah, 

Seems you misunderstood my question.

I'm asking about Qlik Sense app development and you have mentioned about Excel app.

Thank you for the reply.