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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bar Chart Dimension Issue

Hello,

I am a beginner on QlikView, and i would to create a chart which shows the result of the 12 last "MaJ" from the "Maj" Selected (1 year period from the Maj selected) :

Capture.PNG

However my chart shows just the result of the MaJ selected:

Capture.PNG

(Here "STEASoF" = "MaJ")

The dimension:

Capture.PNG

And the Expression looks like:

Capture.PNG

Do you have an idea ?

Thanks for advance for your help,

Cocalero.

35 Replies
sunny_talwar

I think the only issue with AddMonths is that the dates we are seeing in the sample doesn't seem to be month end dates. I would replace MonthStart with AddMonths. What do you think Stefan?

Sum({$<Job = {'Trader'}, AsOF = {">=$(=MonthStartMax(AsOF),-11))<=$(=Max(AsOF))"}>} STE)

Anonymous
Not applicable
Author

Just one question again:

Why "=AddMonths(Max(STEAsOf),-1)" return 29/01/2016 whereas "Max(STEAsOf)" returns 42429.

Because i have a issue in my file, the formula doesn't work 😕

The Expression: Capture.PNG

STEAsOf Table:

Capture.PNG

The result:

Capture.PNG

Thanks for advance for your help,

Cocalero.

sunny_talwar

Change to this may be:

=Date(Max(STEAsOf), 'DD/MM/YYYY')

UPDATE:

SUM({$<Job = {'Trader'}, AsOF = {">=$(=AddMonths(Max(AsOF),-2))<=$(=Date(Max(AsOF), 'DD/MM/YYYY'))"}>} STE)

swuehl
MVP
MVP

May I just refer to one of my earlier answers:

swuehl wrote:

Maybe like

Sum({$<Job = {'Trader'}, STEAsOf = {">=$(=Num(AddMonths(MaJ,-12)))"}, MaJ= >} STE)

Reason why I used Num() here:

Dates in Set Analysis

So make sure the format matches.

Anonymous
Not applicable
Author

Thanks for your response.

But now with this expression :

=SUM({$<Job_Titles = {'Trader'}, STEAsOf = {">=$(=Num(AddMonths(Max(STEAsOf),-12)))<=$(=Date(Max(STEAsOf), 'DD/MM/YYYY'))"}>} STE)


I have the good result for the newest STEAsOf:

Capture.PNG

But if i choose an other STEAsOf, like 31/12/2015, i have:

Capture.PNG

It adds two columns, and i don't understand why 😕

Then, i saw that the Date in the Table STEAsOf are always not the last days of the Month, so  "Num(AddMonths(Max(STEAsOf),-12)" can't be use i think. How can i choose the Next Item inthe table STEAsOF ?

Thanks for advance,

Cocalero.

sunny_talwar

Did not need to add Num

=SUM({$<Job_Titles = {'Trader'}, STEAsOf = {">=$(=AddMonths(Max(STEAsOf),-12))<=$(=Date(Max(STEAsOf), 'DD/MM/YYYY'))"}>} STE)

Capture.PNG

swuehl
MVP
MVP

Well, you can create another field in your script that just enumerates the field values in chronological order.

Then use the set modifier on that field (and clear selections on the other calendar field).

But I think your issue in above sample is that your upper limit is still formatted as date, use the num() function also on the upper limit.

=SUM({$<Job_Titles = {'Trader'}, STEAsOf = {">=$(=Num(AddMonths(Max(STEAsOf),-12)))<=$(=Num(Max(STEAsOf)))"}>} STE)


Anonymous
Not applicable
Author

Thanks but with the expression: "=NUM(AddMonths(Max(AsOf),-1))" in the Text Box i have:

Capture.PNG

Do there is a difference between these data (42367 and 42369)

sunny_talwar

I am totally confused now. Do you have STEAsOf in number format or date format?

Anonymous
Not applicable
Author

Number Format but the issue is still here:

Capture.PNG

Cocalero