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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart formula

Hi,

could you pls advice me a formula for a chart in actual month.

I have dimensions - year,month. Than i have 4 expressions(sales) and i need to create a pie chart for actual period. A pie chart will concist 4 expressions = 100%. There must be a formula,that should say - for all 4 expressions take only sales in actual month (something like MAX month)

Could you tell me how i could do it

Thx

Jerry

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Month, Year and Sales are the fields. So anything starting with a Capital is a field.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You should be able to use set analysis expressions. To get the sum of Sales of the last month try:

sum({<Year={$(=max(Year))},Month={"$(=max({<Year={$(=max(Year))}>}Month))"} >} Sales)

Months can be troublesome because they can have a textual and a numeric value. If you have such a Month field you may need this instead:

sum({<Year={$(=max(Year))},Month={"=num(Month)=$(=max({<Year={$(=max(Year))}>}Month))"} >} Sales)


talk is cheap, supply exceeds demand
Not applicable
Author

Dear Gysbert,

thanks for you advice. Could you tell me,what in your formula (year,month) is a dimension field and what is a function.I have for my existing field for year and month a czech names in databasses (instead of year="Rok",instead of month="Měsíc" and now i cannot find out what´s function and what´s my existing field.I tried a few combination,but my chart doesn´t work and cannot display any data.

Thx a lot for your message:-)

J.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Month, Year and Sales are the fields. So anything starting with a Capital is a field.


talk is cheap, supply exceeds demand
Not applicable
Author

Yeah,it works now correctly:-)

Thx a lot

J.