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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

Field between two values

Hello ,

I have a field named Month_Time and i add Inline with numbers for every month  

 

load * inline [

"Time Month", Month_ID

'Jan', 1

'Feb', 2

'Mar', 3

'Apr', 4

'May',5
'Jun',6
'Jul',7
'Aug',8
'Sep',9
'Oct',10
'Nov',11
'Dec',12

];

 

 

Now I have a field named Sales and i want if i select 3 or March I do the sum of sales the first 3 months I tried like that but it doesn't work 

Sum({$<Month_ID={">=0<=$(max(month_ID))"}>} Sales)

 

 

Thanks for help 

1 Solution

Accepted Solutions
kjhertz
Partner - Creator
Partner - Creator

Try something like this:

Sum({$<[Time Month]=, Month_Id={"<=$(=max(Month_Id))"}>} Sales)

 

View solution in original post

5 Replies
Anil_Babu_Samineni

How about this?

Sum({$<Month_ID={">=$(=Min({1} month_ID))<=$(max(month_ID))"}>} Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
zied_ahmed1
Specialist
Specialist
Author

Hello Thanks for your answer but  it doesn't work 

zied_ahmed1
Specialist
Specialist
Author

It select only the max value together
kjhertz
Partner - Creator
Partner - Creator

Try something like this:

Sum({$<[Time Month]=, Month_Id={"<=$(=max(Month_Id))"}>} Sales)

 

Anil_Babu_Samineni

What if [Time Month] is the Filter? Could be there is some problem in your month_ID field?

First try this in script to create field
Num(month(date#([Time Month],'MMM'))) as Month_ID

And expression is

Sum({$<Month_ID={"<=$(Max(Month_ID))"}>} Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful