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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to get data of current year and last year in a single graph with two expression in qlikview

how to get sale of current year and last year in a single graph with two expression

i"m using this expresion

current year:=SUM({<FiscalYearName={'$(vCFY)' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

last year:

=SUM({<FiscalYearName={'$(vLFY)' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of Meal]))

6 Replies
sasikanth
Master
Master

Hi , try some thing like this

Current Year:

SUM({<FiscalYearName={$(=max(year) },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

Previous Year

SUM({<FiscalYearName={$(=max(year-1) },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

its_anandrjs
Champion III
Champion III

If you use variables then try with

Let vCFY =Max(Year);

Let vLFY =Max(Year)-1;

Current year:=SUM({<FiscalYearName={'$(vCFY)' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

Last year:

=SUM({<FiscalYearName={'$(vLFY)' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of Meal]))

Or you can use it without variables

Current Yr:=SUM({<FiscalYearName={'$(=Max(Year))' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

Last Yr: =SUM({<FiscalYearName={'$(=Max(Year)-1)' },Flag={'IFK'}  >}_Revenue)/sum(([Total No of Meal]))

Not applicable
Author

data is not reflecting by these expression . can you suggest something else???

Not applicable
Author

can any1 suggest something please ????

Not applicable
Author

please suggest ? i'm stucked.|||||

sasikanth
Master
Master

hi

Current Year:

SUM({<FiscalYearName={"$(=max(year)" },Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

Previous Year

SUM({<FiscalYearName={"$(=max(year)-1) "},Flag={'IFK'}  >}_Revenue)/sum(([Total No of SALE]))

check the above and   "  _Revenue" --> this field name is correct or not

or else

share your  .QVW