Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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) :
However my chart shows just the result of the MaJ selected:
(Here "STEASoF" = "MaJ")
The dimension:
And the Expression looks like:
Do you have an idea ?
Thanks for advance for your help,
Cocalero.
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)
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:
STEAsOf Table:
The result:
Thanks for advance for your help,
Cocalero.
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)
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:
So make sure the format matches.
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:
But if i choose an other STEAsOf, like 31/12/2015, i have:
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.
Did not need to add Num
=SUM({$<Job_Titles = {'Trader'}, STEAsOf = {">=$(=AddMonths(Max(STEAsOf),-12))<=$(=Date(Max(STEAsOf), 'DD/MM/YYYY'))"}>} STE)
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)
Thanks but with the expression: "=NUM(AddMonths(Max(AsOf),-1))" in the Text Box i have:
Do there is a difference between these data (42367 and 42369)
I am totally confused now. Do you have STEAsOf in number format or date format?
Number Format but the issue is still here:
Cocalero