Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Lakshminarayanan_J

SET Expression Not Working

Hi ALL,

Need to implement the below logic.

 Stock Logic: Current month closing value/last 3 months Avg secondary sales value /30

Expression Used: num(Sum({<Month={$(=Month)}>}(Closing_Value/1000))
/ (sum({<Month={">=$(=max(Month)-2)<=$(=max(Month))"}>}(Sales_Value/1000))/3)*30,'#,##0')

When Selecting the Month Data is Displaying Correctly,

Issue : When month is not selected it need to display the Stock data for all the month ,but it is not displaying data correctly ,Kindly help on sorting this issue.

 

QlikView @sunny_talwar @kdr_Qv @tm_burgers 

Please find the below table with current logic and expected data:

MonthClosing ValueSales ValueStock Expression:(Current Logic)
num(Sum({<Month={$(=Month)}>}(Closing_Value/1000))
/ (sum({<Month={">=$(=max(Month)-2)<=$(=max(Month))"}>}(Sales_Value/1000))/3)*30,'#,##0')
Expected Data
Jan1,306,3761,695,429-69
Feb1,320,0131,786,609-34
Mar1,146,2661,948,894-19
Apr1,278,7241,528,215-22
May1,271,1701,502,994-23
Jun1,338,6751,627,301-26
Jul1,272,9251,707,120024
Aug1,525,3462,132,017025
Sep1,549,9592,184,524023

 

Kindly help on this !

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button
1 Solution

Accepted Solutions
tm_burgers
Creator III
Creator III

Hey JLVS, 

The below expression has worked for me in my test environment; you can wrap it in num() if you would like, but can also just use the number formatting for the measure too.

 

 

(Sum(Closing_Value/1000)/((Sum(Aggr(
RangeSum(Above(Sum(Sales_Value), 0, 3))
, Month))/1000)/3))*30

 

 

 

View solution in original post

3 Replies
tm_burgers
Creator III
Creator III

Hey JLVS, 

The below expression has worked for me in my test environment; you can wrap it in num() if you would like, but can also just use the number formatting for the measure too.

 

 

(Sum(Closing_Value/1000)/((Sum(Aggr(
RangeSum(Above(Sum(Sales_Value), 0, 3))
, Month))/1000)/3))*30

 

 

 

tm_burgers
Creator III
Creator III

Sorry @Lakshminarayanan_J ; I didn't see that this was posted in QlikView, I assume the expression will still work but I do not have QV to test it. 

Lakshminarayanan_J
Author

Hi @tm_burgers ,

Apologies for delay response above expression is working fine for month dimention

Lakshminarayanan J
To help users find verified answers, please don't forget to use the "Accept as Solution" button