Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
venkanna_info
Partner - Contributor
Partner - Contributor

Looking for suggestion on below query

Hi,

Can anyone help me on the below queries

1.How to calculate Halfyear and Financial year for given date(ex:OrderDate).

2.Sales growth TY vs LY (TY=This Year and LY=Last Year) using KPI object with conditioning color.


3.YTD sales, LY YTD sales and Year salary.

Color code: TY YTD<LY YTD, RED arrow down

Color code: TY YTD>LY YTD, Green arrow Up


4.Make a Point Map object showing City wise sales across the globe. Bubble size should vary with sales amount.

TY YTD<LY YTD, RED , TY YTD>LY YTD, Green


4 Replies
Anonymous
Not applicable

   Hi Please Try these measures and let me know if it works.

Last Year to Datesum({<Year={'$(=max(Year)-1)'},Month ={'<=$(=num(month(Today())))'}>}Sales)
Current Year to Datesum({<Year={'$(=max(Year))'},Month ={'<=$(=num(month(Today())))'}>}Sales)
Running Totalrangesum(above(sum([Material Cost]),0,rowno()))
Current Year SalesSum( {<year={'$(=max(year))'}>} Sales)
Last Year Salessum({<year={'$(=max(year)-1)'}>} Sales)

For Text Coloring to change follow the steps:

1. Right Click on the text object and go to general background color select color icon.

Capture.PNG

2. In the Base Color Check the Icon Calculated instead of base color and enter the following expression.

if(sum({<Year={'$(=max(Year))'}>}Sales) > sum({<Year={'$(=max(Year)-1)'}>}Sales) , green(),red())

Capture1.PNG

Hope this should be helpful. Let me know if you have any questions.

Thanks

Mouna Chandra.

venkanna_info
Partner - Contributor
Partner - Contributor
Author

Tq.its works.can u explain me conditional colors in qliksense

if(sum({<Year={'$(=max(Year))'}>}Sales) > sum({<Year={'$(=max(Year)-1)'}>}Sales) , green(),red())

I am getting different result if i applied above code for measures.

datanibbler
Champion
Champion

Hi,

that is a set_analysis_statement - in case the sum of sales in the last year (where >> Year = max(Year <<) is bigger than the sum of the prior year (where >> Year = (max(Year)-1) <<), then it turns green, otherwise it turns red.

Inside the set_analysis, the field >>Year<< is compared to the value in {} and within that, using that '$()' part, Mouna is apparently building an expression which is then evaluated first (and then the field >>Year<< is compared to that expression)

Anonymous
Not applicable

Hope Friedrich Hofmann reply helps you. can you Please close the thread by marking it correct?