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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
SyedBasha
Contributor III
Contributor III

Qlik multiple selection issue

 In qlikscript if my month is Apr 2020 my calculate date looking as May 01like start of may if my month is May 2020 calculate date is Jun 01 etc....but the actual problem is when i select both the months like April 2020 and May 2020 my calculate date is Jun 01 wise please help me on this


 In script level only needed

 

Attached example screen shot 

Screenshot_2025-10-29-18-48-43-05_95dbc2b164ac5249587bf655507ac86b.jpg

Labels (2)
7 Replies
Lisa_P
Employee
Employee

What is the script calculating this ?

SyedBasha
Contributor III
Contributor III
Author

In script level I want to show number(calculatedate- min(effectdate)) * net premium  as Dailynetpremium

calculatedate script is (Date(Monthname(addmonths(max(Effectdate),1)),'YYYY-MM-DD')

calculatedate is creating a problem while i am selecting current month in UI getting a correct results but, while i am selecting multiple months the result is not getting correct, In calculatedate I want to create like this.

Screenshot_2025-10-29-18-48-43-05_95dbc2b164ac5249587bf655507ac86b.jpg

SyedBasha
Contributor III
Contributor III
Author

Single month selection → returns next month’s first date  

- Multiple months → returns the latest selected month + 1  

- Dynamic month handling for any year/month combination

Lisa_P
Employee
Employee

Because you are looking at dynamic values based on selections, you will need to do dynamic calculation in the chart to display max(CalculatedDate) as a measure, to show the result you are looking for.

SyedBasha
Contributor III
Contributor III
Author

@qlikqlik @Qlik3 could you please help me on the above solution 

PrashantSangle

Script does not work in that way, in which way you are thinking now. Scripts are like SQL. It worked base on filter/where parameter you passed while writing script. Once Script run it load the required data in dashboard & on the top of that you can play with Set Analysis or front end function. 

But if you want to pass the value from your selection in the front end to back end (Script) then create variable which hold that selection value & create Reload button on front end. So it will work something like

if you select Apr & Jun both month --> variable will hold max(month) --> Jun 

then by Clicking on reload button you can use that value in backend script.

 

Hope that make sense.

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
SyedBasha
Contributor III
Contributor III
Author

Thanks for sharing Prashant, can you please share some examples