Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

paolosacco
New Contributor

Question about dates on graph

hi everyone,

I've a db with the number of employees divided per month

dates are stored with the format MM-YY


i would like to sum in one graph the total of employees belonging to the last updated month.

the title of the page is : Date(Max([DB Headcount.Validity Date]), 'MM-YY') and it shows me correctly "12-17"


If i use the function


Sum({$<[DB Headcount.Validity Date]={"12-17"}>}[DB Headcount.HC])

the graph works correctly

but the following function within the same graph doesn't work:

Sum({$<[DB Headcount.Validity Date]={"Date(Max([DB Headcount.Validity Date],'MM-YY'))"}>}[DB Headcount.HC])

any clue?

thanks

paolo

3 Replies
zebhashmi
Valued Contributor

Re: Question about dates on graph

Try that

Sum({$<[DB Headcount.Validity Date]={"$(Date(Max([DB Headcount.Validity Date],'MM-YY')))"}>}[DB Headcount.HC])

Or may be this

Sum({$<[DB Headcount.Validity Date]={"=$(Date(Max([DB Headcount.Validity Date],'MM-YY')))"}>}[DB Headcount.HC])

paolosacco
New Contributor

Re: Question about dates on graph

not working.. shows just o value

OmarBenSalem
Esteemed Contributor

Re: Question about dates on graph

Sum({$<[DB Headcount.Validity Date]={"$(=Date(Max([DB Headcount.Validity Date],'MM-YY')))"}>}[DB Headcount.HC])


u are missing the $(=urExpression) :

when u use a set analysis to force a condition:

1)if it's numeric: u write directly: Year={2013}

2)if it's a string: btwn quotes: Country={'Tunisia'}

3)if it's a function , u surround ur function with $() and double quotes: Year={"$(=max(Year))"}

4)if u're using a comparison function , u put = and double quotes: Year={"=sum(Sales)>5000"}


hope this helps

Community Browser