Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
What is the script calculating this ?
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.
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
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.
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
Thanks for sharing Prashant, can you please share some examples